When we compute a hash for an Elasticsearch request (currently only used in the AWS request signing), we take advantage of this opportunity to compute the content length, and set it on the entity. But, as we don't want to advertise different content-length to different callers, we also take care to freeze the content length as soon as it's been requested through getContentLength, making later content length computation useless. As it happens, the request interceptor org.apache.http.protocol.RequestContent is always executed before the AWS signing interceptor, effectively making the content length computation useless when doing AWS signing. We should either find a way to perform this content length computation sooner, or remove it altogether, because as it is, it's useless. |