Skip to content
Browse files

Fix processing of Content-Length header in single-packet HTTP responses

  • Loading branch information...
1 parent f0cac70 commit dbb39f7b213f4d1e1fc7d0f17d997ddefd457e93 @catwood catwood committed Nov 1, 2012
Showing with 6 additions and 7 deletions.
  1. +6 −7 scripts/framework/Http.js
View
13 scripts/framework/Http.js
@@ -140,13 +140,12 @@ var Http = new Class({
var tmpHeaders = tmp[i].split(": ");
this.responseHeaders[tmpHeaders[0]] = tmpHeaders[1];
}
- } else {
- if ($defined(this.responseHeaders['Content-Length']) && this.getContentSize() >= this.responseHeaders['Content-Length']) {
- this.socket.close();
- }
- if ($defined(this.responseHeaders['Location'])) {
- socket.close();
- }
+ }
+ if ($defined(this.responseHeaders['Content-Length']) && this.getContentSize() >= this.responseHeaders['Content-Length']) {
+ this.socket.close();
+ }
+ if ($defined(this.responseHeaders['Location'])) {
+ socket.close();
}
}
}.bind(this);

0 comments on commit dbb39f7

Please sign in to comment.
Something went wrong with that request. Please try again.