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

Fl4m3Ph03n1x
Background Let’s assume I have a typical GenServer that receives messages as requests, does some operation in a DB and returns responses....
New
JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
pgiesin
This should be a simple problem but I just can’t seem to figure it out. I have a standalone Elixir app that won’t find the database. Dep...
New
New
quazar
How to set Jason to encode all fields in ecto schema, I don’t care about security and implementing only is taking long list of attributes...
New
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
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
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New
Codball
Mix format works fine if run from the cmd. I’ve followed this to facilitate the implementation into VSC which involves downloading an ext...
New

Other popular topics Top

belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
977 41022 311
New
yurko
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 49522 488
New
dokuzbir
Hello, I am trying to convert my lists to string without losing brackets.For start i have 3 map. They look like these buyer = %{ id: ...
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
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
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
Nvim
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
New

We're in Beta

About us Mission Statement