Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Status codes as floats #697

Open
luoken opened this issue Nov 9, 2021 · 2 comments
Open

Status codes as floats #697

luoken opened this issue Nov 9, 2021 · 2 comments
Assignees

Comments

@luoken
Copy link

luoken commented Nov 9, 2021

There seems to be some sites that return status codes as floats e.g. http://www.lowiqcanadian.com/id2.html.

When running curl --head http://www.lowiqcanadian.com/id2.html we see that the status code returned is actually a 401.1 and hackney does not like that as it tries to convert the float into an integer.

Here are some status codes that are floats: https://docs.microsoft.com/en-us/troubleshoot/iis/http-status-code

@tsloughter
Copy link

I was curious about this because the HTTP spec defines the status code as 3 digit integer. I wouldn't be surprised that IIS breaks the spec but when I curl that url I get a 404.

Either way I don't think hackney should support it but I'm curious to see if it actually returns 401.1 and that is able to be handled by curl.

@benoitc
Copy link
Owner

benoitc commented Aug 4, 2022

The spec indeed defines it as a 3 digit integer : https://datatracker.ietf.org/doc/html/rfc7231#section-6

This is a low priority actually to support microsoft insanity and will come after the new connection engine but i think this can be done. Of course Microsoft pushed the insanity to the point it can be more than one digit after which makes things slower to check but we can actually parse it digit by digit. It will be slower though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants