tjg184 / urlrewritefilter

Automatically exported from code.google.com/p/urlrewritefilter
Other
0 stars 0 forks source link

RequestProxy.java patch for type=proxy with proxy target returning 'transfer-encoding: chunked' #36

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. setup rule that uses type="proxy"
2. setup proxy target that returns output as 'chunked' output. I used
geoserver.  Use any geoserver setup.
3.

What is the expected output? What do you see instead?

When proxying the chunked response back to the requester, the data is
accumulated (probably incorrectly) rather than returned untouched. A
logically complete response is returned instead but the header
'transfer-encoding: chunked' is not removed from the response to the
requester.  This randomly breaks images and Geoserver's map tiles.

I fixed this for my case (by removing the transfer-encoding header) but I'm
sure there are cases where the encoding should be preserved the chunks
returned mostly untouched.  This fix will likely not help streaming
sources...  Map tiles have a definitive end.  I leave it to you to decide
what to do.  I would at least appreciate the inclusion of this patch as
type=proxy is not usable for the quasi case now.

What version of the product are you using? On what operating system?

urlrewrite 3.2 on Linux/Windows with JBOSS 4.2.2.GA.

Please provide any additional information below.

This is key to moving GeoServer behind a proxy!  Hopefully others can benefit.

Original issue reported on code.google.com by fortes...@gmail.com on 18 May 2009 at 6:45

Attachments:

GoogleCodeExporter commented 9 years ago
I'm applied this patch and it looks good, but in setupResponseHeaders isChunked
always appears to be false?  Is this correct?

Original comment by tuc...@gmail.com on 10 Aug 2009 at 10:34

GoogleCodeExporter commented 9 years ago
Has this patched in the trunk code?

Original comment by benzhe...@gmail.com on 8 Oct 2009 at 7:28

GoogleCodeExporter commented 9 years ago
I came across this issue today while trying to pull a bunch of AJAX URLs into 
the same domain. Solved it for my 
environment by simply suppressing the transfer-encoding header in the 
setupResponseHeaders method.

Attached is a smaller patch.

Original comment by zhemchu...@gmail.com on 14 Oct 2009 at 6:13

Attachments:

GoogleCodeExporter commented 9 years ago
We also had a similar problem with proxying from one webapp to another within a 
single Tomcat container. For smallish responses like a few hundred bytes both 
"Transfer-Encoding: Chunked" and "Content-Length: " HTTP headers were present 
in the response while the response itself was non-chunked. For larger, chunked 
encoded responses the HTTP header "Transfer-Encoding: Chunked" was present 
twice. The first case confused browser-clients like Mozilla, but e.g. not 
'wget' clients.

We applied the 2nd patch here above (Comment 3 by zhemchu...@gmail.com, Oct 13, 
2009). This fixed the problem for us. I think I've also found the issue still 
present in urlrewritefilter v4 and trunk.

Original comment by jus...@gmail.com on 11 Oct 2011 at 1:18

GoogleCodeExporter commented 9 years ago
2nd patch committed onto main trunk.  I think this should fix the issue for 
most people.

http://code.google.com/p/urlrewritefilter/source/detail?r=325

Original comment by p...@tuckey.org on 31 Oct 2011 at 3:03