klo
Hackney support for float status codes
Is there any solution / workaround for hackney when status codes are returned as a float? ex: 401.1
when I try to run HTTPoison.get("http://www.lowiqcanadian.com/id2.html") inside of iex i get
** (ArgumentError) argument error
:erlang.list_to_integer('401.1')
(hackney 1.17.4) /Users/k/v-repo/fetchers/deps/hackney/src/hackney_http.erl:221: :hackney_http.parse_reason/4
(hackney 1.17.4) /Users/k/v-repo/fetchers/deps/hackney/src/hackney_response.erl:74: :hackney_response.wait_status/1
(hackney 1.17.4) /Users/k/v-repo/fetchers/deps/hackney/src/hackney.erl:378: :hackney.send_request/2
(httpoison 1.8.0) lib/httpoison/base.ex:846: HTTPoison.Base.request/6
The issue seems to be from hackney not supporting status codes as floats and is actively trying to convert 401.1 into an integer. Does anyone have a workaround for this?
looks like there are some float status codes here.
Most Liked
kip
I asked this question on stackoverflow to see what comes back. Seems very strange that iIS would return non-compliant status codes and I can’t find any update to RFC7231 that would suggest the standard has been updated.
derek-zhou
It is a badly configured junk site for sure, but still Hackney should not crash. I tried a few http clients in other languages and most of them give some sort of degraded response instead of crashing.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #hex
- #security









