From bc6d32f4f1f2e1c2d234aec66ec43996e627b8f9 Mon Sep 17 00:00:00 2001 From: Andrei Nesterov Date: Sun, 7 May 2017 00:01:16 +0300 Subject: Do not expect a message body for 204, 304 status codes of HTTP/1.1 --- src/gun_http.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gun_http.erl b/src/gun_http.erl index eac9ede..6546df9 100644 --- a/src/gun_http.erl +++ b/src/gun_http.erl @@ -420,7 +420,7 @@ request_io_from_headers(Headers) -> response_io_from_headers(<<"HEAD">>, _, _, _) -> head; -response_io_from_headers(_, _, 204, _) -> +response_io_from_headers(_, _, Status, _) when (Status =:= 204) or (Status =:= 304) -> head; response_io_from_headers(_, Version, _Status, Headers) -> case lists:keyfind(<<"content-length">>, 1, Headers) of -- cgit v1.2.3