> Hi all,
>
> I've run into a situation here where I need to go through a proxy (using
> squid for testing, at the moment) to the webdav servlet.
>
> The webdav client libraries have a bit of a problem here - no support
> for proxies. I've hacked it in for now (it's pretty ugly. I'll send a
> patch to anyone that's interested, but it isn't really release-quality
> code, I just needed a solution immediately).
>
> However, there's one more problem - squid complains (and returns a 411
> error) if methods which aren't meant to have a Content-Length header
> have one. For example, a get request should NOT have a content-length.
> Right now, we send content-length whenever we can, though it'll often be
> the default value (I haven't checked, but I imagine this is 0). So, we
> need to suppress this on methods that don't need it.
Where did you read that ?
As long as the content length value is accurate (ie, equals 0 when doing a
GET), I fail to see why it would be forbidden (and couldn't find that in the
HTTP/1.1 spec).
411 means Length required, so it should be returned in the exact opposite
case.
> What's a neat solution to this? Should we: a) get each method to print
> content-length if they need it, b) have a function in each method class
> like this: boolean needContentLength(), and print based on that, or c)
> (my current solution, for the moment, mostly because it's quick and easy
> for a single special case) - just have it suppress the content-length
> header if the method is a GET (that's the only one - so far - that's
> caused a problem for me).
Remy