> juergen 01/09/14 10:06:43
>
> Modified: src/webdav/client/src/org/apache/commons/httpclient
> HttpMethodBase.java
> Log:
> Ignore a user set content-length and let HttpClient re-compute it.
> + // remove a pre-set content length header, if present
> + // and let the HttpClient class compute this.
> + if (requestHeaders.containsKey("Content-Length") &&
this.needContentLength()) {
> + requestHeaders.remove("Content-Length");
> + }
> + if (requestHeaders.containsKey("content-length") &&
this.needContentLength()) {
> + requestHeaders.remove("content-length");
> + }
Is it really a good idea to do that ?
That means that all the requests will be chunked, which is not a good idea
(and forbidden when doing a POST).
Really, I would trust the user there. If we choose to not trust him, we can
see how many bytes are actually written and complain (and close the
connection) if it doesn't match.
Remy