diff options
author | Loïc Hoguin <[email protected]> | 2017-11-15 14:57:10 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2017-11-15 14:57:10 +0100 |
commit | aca7a1c5f5353fd3fbf90877a78761590fc08510 (patch) | |
tree | 9bbeb5e0635e6cb5cafe4ef3f921c8fe316f9853 | |
parent | cbbb4d5523f8738b237593f9516c3a237d0cc2f4 (diff) | |
download | gun-aca7a1c5f5353fd3fbf90877a78761590fc08510.tar.gz gun-aca7a1c5f5353fd3fbf90877a78761590fc08510.tar.bz2 gun-aca7a1c5f5353fd3fbf90877a78761590fc08510.zip |
Fix a potential issue finding end of headers in HTTP/1.1
This is a bit less efficient but necessary in case we
start getting the beginning of \r\n\r\n and it cuts just
there.
-rw-r--r-- | src/gun_http.erl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gun_http.erl b/src/gun_http.erl index 26761a8..ef8d720 100644 --- a/src/gun_http.erl +++ b/src/gun_http.erl @@ -94,7 +94,7 @@ handle(_, #http_state{streams=[]}) -> %% Wait for the full response headers before trying to parse them. handle(Data, State=#http_state{in=head, buffer=Buffer}) -> Data2 = << Buffer/binary, Data/binary >>, - case binary:match(Data, <<"\r\n\r\n">>) of + case binary:match(Data2, <<"\r\n\r\n">>) of nomatch -> State#http_state{buffer=Data2}; {_, _} -> handle_head(Data2, State#http_state{buffer= <<>>}) end; |