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

gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 record...
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
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
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
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
LegitStack
I’m trying to make a websocket server in Phoenix or raw Elixir. I heard about gun, I think I could use cowboy, but since I’m not that sma...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
idi527
I’ve been re-reading swift book again and noticed that multiline strings there don’t have a trailing line break, unlike in elixir iex(2)...
New

Other popular topics Top

dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
AstonJ
You’re a programmer, so you don’t need spoon feeding with the conventional drivel about “this is an integer.” No. You need to know what’s...
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
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New

We're in Beta

About us Mission Statement