Permalink
Browse files

fix for webrick warning: Could not determine content-length of respon…

…se body.
  • Loading branch information...
skaes committed Sep 17, 2012
1 parent db81715 commit 0766b45d157585c91ae4818db817131c88048759
@@ -0,0 +1,13 @@
+diff --git a/lib/webrick/httpresponse.rb b/lib/webrick/httpresponse.rb
+index 0d36c07..ce72b3f 100644
+--- a/lib/webrick/httpresponse.rb
++++ b/lib/webrick/httpresponse.rb
+@@ -202,7 +202,7 @@ module WEBrick
+ if @header['connection'] == "close"
+ @keep_alive = false
+ elsif keep_alive?
+- if chunked? || @header['content-length']
++ if chunked? || @header['content-length'] || @status == 304 || @status == 204
+ @header['connection'] = "Keep-Alive"
+ else
+ msg = "Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true"
@@ -6,3 +6,4 @@ railsexpress/05-track-live-dataset-size.patch
railsexpress/06-export-some-symbols-for-rubyprof.patch
railsexpress/07-revert-f6b49243eb0c21bea1c4198cdd52a549e6ead075.patch
railsexpress/08-backport-c2086cc7ff1142b14c95c.patch
+railsexpress/09-webrick_204_304_keep_alive_fix.patch

0 comments on commit 0766b45

Please sign in to comment.