Chris Withers wrote: > - Apache in this instance responds with HTTP 1.1, even though the wget > request was 1.0, is that allowed? > > - Apache responds with a chunked response only to httplib. Why is that? > I find it very confusing that you say "Apache" since your really want to say "Coyote" which is to say "Tomcat". Http11Processor.java at 1547: if (entityBody && http11 && keepAlive) { outputBuffer.addActiveFilter (outputFilters[Constants.CHUNKED_FILTER]); contentDelimitation = true; headers.addValue( Constants.TRANSFERENCODING).setString(Constants.CHUNKED); } else { outputBuffer.addActiveFilter (outputFilters[Constants.IDENTITY_FILTER]); } So, as Oleg said, it's because httplib talks HTTP/1.1 and wget talks HTTP/1.0. All HTTP/1.1 client must support chunked transfer-encoding, and apparently Tomcat/Coyote defaults to that unless it is either an empty message, not a HTTP/1.1 client, or the request is not to be kept alive ("Connection: close" or no more keep-alive slots on the server). As Simon said, changing this to do ''.join(chunks) is really the best first step to take. -Scott -- Scott Dial scott at scottdial.com scodial at cs.indiana.edu
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4