-
Notifications
You must be signed in to change notification settings - Fork 436
Closed
Description
For a few URLs, we are seeing the following error when reading the body of a hackney client request: ** exception error: no case clause matching {error,{poorly_formatted_size,"AAE "}}
The specific URLs that create the above issue:
https://www.zawya.com/uae/en/story/Oman_opens_new_concession_area_bids_for_oil_and_gas_exploration-SNG_107248923/
https://www.zawya.com/mena/en/story/OPEC_daily_basket_price_6586_a_barrel_Friday-WAM20180108102708038/
https://www.zawya.com/mena/en/story/Asian_shares_edged_up_on_Tuesday-ZAWYA20180109054040/
Steps to create the issue:
application:ensure_all_started(hackney).application:start(crypto), application:start(public_key), application:start(ssl), application:start(hackney).Method = get, URL = <<"https://www.zawya.com/mena/en/story/OPEC_daily_basket_price_6586_a_barrel_Friday-WAM20180108102708038/">>, Headers = [], Payload = <<>>, Options = [], {ok, StatusCode, RespHeaders, ClientRef} = hackney:request(Method, URL, Headers, Payload, Options).{ok, Body} = hackney:body(ClientRef).
Just to be thorough, I have included the output of the above steps below for convenience:
Erlang/OTP 20 [erts-9.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:0] [hipe] [kernel-poll:false]
Eshell V9.1 (abort with ^G)
1> application:ensure_all_started(hackney).
{ok,[unicode_util_compat,idna,mimerl,certifi,ssl_verify_fun,
metrics,hackney]}
2> application:start(crypto),
2> application:start(public_key),
2> application:start(ssl),
2> application:start(hackney).
{error,{already_started,hackney}}
3> Method = get,
3> URL = <<"https://www.zawya.com/mena/en/story/OPEC_daily_basket_price_6586_a_barrel_Friday-WAM20180108102708038/">>,
3> Headers = [],
3> Payload = <<>>,
3> Options = [],
3> {ok, StatusCode, RespHeaders, ClientRef} = hackney:request(Method, URL, Headers, Payload, Options).
{ok,200,
[{<<"Date">>,<<"Fri, 23 Feb 2018 21:50:48 GMT">>},
{<<"Server">>,<<"Apache-Coyote/1.1">>},
{<<"Access-Control-Allow-Origin">>,<<"*">>},
{<<"X-Powered-By">>,<<"JSP/2.2">>},
{<<"Content-Type">>,<<"text/html;charset=UTF-8">>},
{<<"Content-Language">>,<<"en">>},
{<<"Set-Cookie">>,
<<"JSESSIONID=qiZZDyMa-eu7ZyZjldXq0m+X.undefined; Path=/">>},
{<<"Transfer-Encoding">>,<<"chunked">>}],
#Ref<0.1249023865.3095396353.165836>}
4> {ok, Body} = hackney:body(ClientRef).
** exception error: no case clause matching {error,{poorly_formatted_size,"AAE "}}
in function hackney_http:te_chunked/2 (/Users/abenson/Documents/repos/hackney/_build/default/lib/hackney/src/hackney_http.erl, line 415)
in call from hackney_http:transfer_decode/2 (/Users/abenson/Documents/repos/hackney/_build/default/lib/hackney/src/hackney_http.erl, line 358)
in call from hackney_response:stream_body/1 (/Users/abenson/Documents/repos/hackney/_build/default/lib/hackney/src/hackney_response.erl, line 142)
in call from hackney_response:read_body/3 (/Users/abenson/Documents/repos/hackney/_build/default/lib/hackney/src/hackney_response.erl, line 308)
in call from hackney:'-body/1-fun-0-'/1 (/Users/abenson/Documents/repos/hackney/_build/default/lib/hackney/src/hackney.erl, line 490)
5>
Metadata
Metadata
Assignees
Labels
No labels