-
Notifications
You must be signed in to change notification settings - Fork 474
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bump to 2.3.2, Case insensitive match for "Connection: close" (#81)
- Loading branch information
Showing
4 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -383,7 +383,7 @@ should_close() -> | |
DidNotRecv = erlang:get(?SAVE_RECV) =:= undefined, | ||
ForceClose orelse Version < {1, 0} | ||
%% Connection: close | ||
orelse get_header_value("connection") =:= "close" | ||
orelse is_close(get_header_value("connection")) | ||
%% HTTP 1.0 requires Connection: Keep-Alive | ||
orelse (Version =:= {1, 0} | ||
andalso get_header_value("connection") =/= "Keep-Alive") | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
etrepum
via email
Author
Member
|
||
|
@@ -394,6 +394,13 @@ should_close() -> | |
orelse (DidNotRecv | ||
andalso get_header_value("transfer-encoding") =:= "chunked"). | ||
|
||
is_close("close") -> | ||
true; | ||
is_close(S=[_C, _L, _O, _S, _E]) -> | ||
string:to_lower(S) =:= "close"; | ||
is_close(_) -> | ||
false. | ||
|
||
%% @spec cleanup() -> ok | ||
%% @doc Clean up any junk in the process dictionary, required before continuing | ||
%% a Keep-Alive request. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 comments
on commit 9d205a8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if we just make the return value of get_header_value/1 to lower case? If it is a string().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In some cases it makes sense to have the header unmodified, it would
certainly cause other kinds of regressions if we changed the current
behavior.
…On Sunday, July 29, 2012, Logan Zhou wrote:
What if we just make the return value of get_header_value/1 to lower case?
If it is a string().
---
Reply to this email directly or view it on GitHub:
9d205a8#commitcomment-1644079
shouldn't it be the same for keep-alive then?