diff options
author | Henrik Nord <[email protected]> | 2014-03-21 16:37:56 +0100 |
---|---|---|
committer | Henrik Nord <[email protected]> | 2014-03-21 16:37:59 +0100 |
commit | ae7a69f2840009d2313a52887bb2964347736954 (patch) | |
tree | 07615dc3c371c843f566bd6972f4bcd8e3934ee5 /lib/inets/src/http_client | |
parent | 9d46875b53ffb21bc55aec4a2c76472133ea5d1c (diff) | |
parent | 06c3cc2857b099fb4e08449b9518db808c9f4b2b (diff) | |
download | otp-ae7a69f2840009d2313a52887bb2964347736954.tar.gz otp-ae7a69f2840009d2313a52887bb2964347736954.tar.bz2 otp-ae7a69f2840009d2313a52887bb2964347736954.zip |
Merge branch 'nox/httpc-transfer-encoding-identity'
* nox/httpc-transfer-encoding-identity:
Support identity transfer-encoding in httpc
OTP-11802
Diffstat (limited to 'lib/inets/src/http_client')
-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 b4894d93cd..88e08be789 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) -> |