ninenines / gun

HTTP/1.1, HTTP/2, Websocket client (and more) for Erlang/OTP.
ISC License
891 stars 232 forks source link

badmap error when sending a request while the connection is not established #234

Closed galdor closed 3 years ago

galdor commented 3 years ago

Context

Issue

The connection was created without any special option, just gun:open/3 with an host and port. There is no server listening on this port so I expect Gun to try to reconnect regularly. I then call gun:post/5 and wait for a response. I get a badmap error, the call being

{maps,get,[flow,[],infinity],[{file,"maps.erl"},{line,188}]}

from

{gun,request,6,[{file,".../_build/default/lib/gun/src/gun.erl"},{line,584}]}

I believe someone started using maps and forgot that some places still use lists :)

galdor commented 3 years ago

Programming error, I was passing an empty list for request options, my bad.