klo

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

kip

ex_cldr Core Team

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

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.

Where Next?

Popular in Questions Top

JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New

Other popular topics Top

JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 54921 245
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 44532 311
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement