summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2012-09-08 21:43:55 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2012-09-08 21:43:57 +0200
commit9a3521cb25e5f0035cf38ed7b16729c8d0dc3c65 (patch)
treef80991d4852da72d24d4bbb9cc7bab46212f2715 /lib
parent0087bc6370c440fad0d8fc61515a7c02e9f8ae1b (diff)
downloadandroid-node-v8-9a3521cb25e5f0035cf38ed7b16729c8d0dc3c65.tar.gz
android-node-v8-9a3521cb25e5f0035cf38ed7b16729c8d0dc3c65.tar.bz2
android-node-v8-9a3521cb25e5f0035cf38ed7b16729c8d0dc3c65.zip
http: respect HTTP/1.0 TE header
A HTTP/1.0 client does not support 'Transfer-Encoding: chunked' unless it explicitly requests it by sending a 'TE: chunked' header. Before this commit, node.js always disabled chunked encoding for HTTP/1.0 clients. Now it will scan for the TE header and turn on chunked encoding if requested and applicable. Fixes #940.
Diffstat (limited to 'lib')
-rw-r--r--lib/http.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/http.js b/lib/http.js
index 87199ea3ac..e226da334a 100644
--- a/lib/http.js
+++ b/lib/http.js
@@ -891,7 +891,7 @@ function ServerResponse(req) {
this.sendDate = true;
if (req.httpVersionMajor < 1 || req.httpVersionMinor < 1) {
- this.useChunkedEncodingByDefault = false;
+ this.useChunkedEncodingByDefault = chunkExpression.test(req.headers.te);
this.shouldKeepAlive = false;
}
}