Don't pass on the Transfer-Encoding header when streaming #671
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When running the hystrix-dashboard on Tomcat with apache in front using AJP/mod_JK, we could not get the streams (from either hystrix directly, or through Turbine) working. In the Chrome JS-console there were errors mentioning the chunked response from proxy.stream was in error.
curling a bit showed this:
curl -iv --raw http://dev.dashboard.finn.no/hystrix-dashboard/proxy.stream?origin=dev-api1.finntech.no/iad/hystrix.stream
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Date: Wed, 11 Feb 2015 13:57:03 GMT
Date: Wed, 11 Feb 2015 13:57:03 GMT
< Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
< Pragma: no-cache
Pragma: no-cache
< Keep-Alive: timeout=1, max=100
Keep-Alive: timeout=1, max=100
< Connection: Keep-Alive
Connection: Keep-Alive
< Transfer-Encoding: chunked
Transfer-Encoding: chunked
< Content-Type: text/event-stream;charset=UTF-8
Content-Type: text/event-stream;charset=UTF-8
<
ping:
So the Transfer-Encoding: chunked header is set, but the data is not actually chunked (Missing a byte-count before the "ping: "-data)
The only related post I could find on google is from 2010 and is related to AJP/mod_JK:
https://issues.apache.org/bugzilla/show_bug.cgi?id=50275 which describes our situation pretty much spot on.
In short: It doesn't seem like the AJP connector wants to get the Transfer-Encoding header from the backend.
The supplied change solved our problems.