diff options
author | Loïc Hoguin <[email protected]> | 2011-04-05 20:07:52 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2011-04-05 20:07:52 +0200 |
commit | 44e6f60b91489e8963a6c197b9897dbeb9d69573 (patch) | |
tree | e24dcecd3311a0aaeee08aff730891fa87f662f6 /src | |
parent | 04a5aa7c5ce82f59ef7f1255264f0fdd7400ee77 (diff) | |
download | cowboy-44e6f60b91489e8963a6c197b9897dbeb9d69573.tar.gz cowboy-44e6f60b91489e8963a6c197b9897dbeb9d69573.tar.bz2 cowboy-44e6f60b91489e8963a6c197b9897dbeb9d69573.zip |
Handle properly the default Connection value for HTTP/1.0.
Fixes a bug reported by evaxsoftware on IRC.
Diffstat (limited to 'src')
-rw-r--r-- | src/cowboy_http_protocol.erl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cowboy_http_protocol.erl b/src/cowboy_http_protocol.erl index 6242fdd..d3d288d 100644 --- a/src/cowboy_http_protocol.erl +++ b/src/cowboy_http_protocol.erl @@ -67,14 +67,16 @@ request({http_request, Method, {abs_path, AbsPath}, Version}, ConnAtom = version_to_connection(Version), wait_header(#http_req{socket=Socket, transport=Transport, connection=ConnAtom, method=Method, version=Version, - path=Path, raw_path=RawPath, raw_qs=Qs}, State); + path=Path, raw_path=RawPath, raw_qs=Qs}, + State#state{connection=ConnAtom}); request({http_request, Method, '*', Version}, State=#state{socket=Socket, transport=Transport}) -> {ok, Peer} = Transport:peername(Socket), ConnAtom = version_to_connection(Version), wait_header(#http_req{socket=Socket, transport=Transport, connection=ConnAtom, method=Method, version=Version, - peer=Peer, path='*', raw_path="*", raw_qs=[]}, State); + peer=Peer, path='*', raw_path="*", raw_qs=[]}, + State#state{connection=ConnAtom}); request({http_request, _Method, _URI, _Version}, State) -> error_terminate(501, State); request({http_error, "\r\n"}, State) -> |