From 06c3cc2857b099fb4e08449b9518db808c9f4b2b Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Sun, 9 Mar 2014 17:16:32 +0100 Subject: Support identity transfer-encoding in httpc > The default (identity) encoding; the use of no transformation whatsoever. > The Internet Assigned Numbers Authority (IANA) acts as a registry for > transfer-coding value tokens. Initially, the registry contains the > following tokens: "chunked" (section 3.6.1), "identity" (section 3.6.2), > "gzip" (section 3.5), "compress" (section 3.5), and "deflate" (section 3.5). Reported-by: Andrew Houghton --- lib/inets/src/http_client/httpc_handler.erl | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'lib/inets/src/http_client') diff --git a/lib/inets/src/http_client/httpc_handler.erl b/lib/inets/src/http_client/httpc_handler.erl index a89a457a51..03cd9aac44 100644 --- a/lib/inets/src/http_client/httpc_handler.erl +++ b/lib/inets/src/http_client/httpc_handler.erl @@ -1119,15 +1119,8 @@ handle_http_body(Body, #state{headers = Headers, handle_response(State#state{headers = NewHeaders, body = NewBody}) end; - Encoding when is_list(Encoding) -> - ?hcrt("handle_http_body - encoding", [{encoding, Encoding}]), - NewState = answer_request(Request, - httpc_response:error(Request, - unknown_encoding), - State), - {stop, normal, NewState}; - _ -> - ?hcrt("handle_http_body - other", []), + Enc when Enc =:= "identity"; Enc =:= undefined -> + ?hcrt("handle_http_body - identity", []), Length = list_to_integer(Headers#http_response_h.'content-length'), case ((Length =< MaxBodySize) orelse (MaxBodySize =:= nolimit)) of @@ -1149,7 +1142,14 @@ handle_http_body(Body, #state{headers = Headers, body_too_big), State), {stop, normal, NewState} - end + end; + Encoding when is_list(Encoding) -> + ?hcrt("handle_http_body - other", [{encoding, Encoding}]), + NewState = answer_request(Request, + httpc_response:error(Request, + unknown_encoding), + State), + {stop, normal, NewState} end. handle_response(#state{status = new} = State) -> -- cgit v1.2.3