spring-cloud-netflix: 411 Content Length required issue

For some reason, my home ISP throws 411 Content length required error when I try to post something to the cloud rest endpoint thru locally running zuul proxy. So I tried setting content-length header manually from a custom filter like: ctx.addZuulRequestHeader("content-length", ctx.getRequest().getHeader("Content-Length"));

But it throws

com.netflix.zuul.exception.ZuulException: Forwarding error...
Caused by: org.apache.http.ProtocolException: Content-Length header already present
    at org.apache.http.protocol.RequestContent.process(RequestContent.java:95)
    at org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:131)
    at org.apache.http.protocol.HttpRequestExecutor.preProcess(HttpRequestExecutor.java:165)
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:485)
    at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:863)

I’m using Zuul 1.0.28. Am I doing anything wrong? I’m not even sure if the original problem would disappear if I manage to set this header manually. Any suggestion, anything would be very much appreciated.

p.s: ISP allows my post request when its done thru Feign.

This issue is originally posted at https://github.com/Netflix/zuul/issues/223.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 27 (17 by maintainers)

Commits related to this issue

Most upvoted comments

We’re fairly close to a 1.1.3. There won’t be any milestones or RC’s.