Commits

Anonymous committed 24eab6d

Actually the *default* is to close the connection, so we should express that in the code as well.

Comments (0)

Files changed (1)

src/lhttpc_client.erl

 read_infinite_body(Socket, _, Hdrs, Ssl) ->
     HdrValue = lhttpc_lib:header_value("connection", Hdrs, "close"),
     case string:to_lower(HdrValue) of
-        "close" -> read_until_closed(Socket, <<>>, Hdrs, Ssl);
-        _       -> erlang:error(no_content_length)
+        "keep-alive" -> erlang:error(no_content_length);
+        _            -> read_until_closed(Socket, <<>>, Hdrs, Ssl)
     end.
 
 read_until_closed(Socket, Acc, Hdrs, Ssl) ->