Permalink
Browse files

Disable input buffering when 'Connection: Upgrade' header is set.

  • Loading branch information...
1 parent cfda7c1 commit df8d020afd8c51998b96f3aac79764f09d321f69 @FooBarWidget FooBarWidget committed Apr 2, 2013
Showing with 10 additions and 0 deletions.
  1. +10 −0 ext/common/agents/HelperAgent/RequestHandler.h
@@ -1544,6 +1544,16 @@ class RequestHandler {
modified = true;
}
+ /* If "Connection: Upgrade" then turn off input buffering. */
+
+ if ((it = map.find("HTTP_CONNECTION")) != end) {
+ if (it->second == "Upgrade" || it->second == "upgrade") {
+ RH_TRACE(client, 2, "HTTP 'Connection: Upgrade' detected; disabling input buffering.");
+ map["PASSENGER_BUFFERING"] = "false";
+ modified = true;
+ }
+ }
+
return modified;
}

0 comments on commit df8d020

Please sign in to comment.