diff options
author | Anthony Ramine <[email protected]> | 2014-03-09 17:16:32 +0100 |
---|---|---|
committer | Anthony Ramine <[email protected]> | 2014-03-09 18:40:36 +0100 |
commit | 06c3cc2857b099fb4e08449b9518db808c9f4b2b (patch) | |
tree | 4cf38cfd8a6814f47090935559d4459fa146e40e /lib/inets/src | |
parent | 870737ab657433c5e8751255fe3c4d298202d142 (diff) | |
download | otp-06c3cc2857b099fb4e08449b9518db808c9f4b2b.tar.gz otp-06c3cc2857b099fb4e08449b9518db808c9f4b2b.tar.bz2 otp-06c3cc2857b099fb4e08449b9518db808c9f4b2b.zip |
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
Diffstat (limited to 'lib/inets/src')
-rw-r--r-- | lib/inets/src/http_client/httpc_handler.erl | 20 |
1 files changed, 10 insertions, 10 deletions
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) -> |