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

nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
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

baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
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
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

We're in Beta

About us Mission Statement