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

Hackney should ignore 1XX responses #695

Open
derek-zhou opened this issue Oct 29, 2021 · 1 comment
Open

Hackney should ignore 1XX responses #695

derek-zhou opened this issue Oct 29, 2021 · 1 comment
Assignees

Comments

@derek-zhou
Copy link
Contributor

Some website send 103 response before the 200, even in http1.1. One such is http://www.theregister.com
It could be a cloudflare thing.

hackney 1.8.0:

iex(3)> :hackney.request("https://www.theregister.com/")

{:ok, 103,
 [
   {"Link",
    "<https://securepubads.g.doubleclick.net/tag/js/gpt.js>; as=\"script\"; rel=\"preload\", </design_picker/aec273bc80dd0dc3a73edce687f7cdaa0e9ef0f5/javascript/_.js>; as=\"script\"; rel=\"preload\", </css_picker/webkit/aec273bc80dd0dc3a73edce687f7cdaa0e9ef0f5/scaffolding.css>; as=\"style\"; rel=\"preload\", </css_picker/webkit/aec273bc80dd0dc3a73edce687f7cdaa0e9ef0f5/design.css>; as=\"style\"; rel=\"preload\", </design_picker/5e49edbd1875f214e0decae1e24b200066780fa8/style/fonts/arimo/arimo-700.latin.woff2>; as=\"font\"; crossorigin; rel=\"preload\", </design_picker/5e49edbd1875f214e0decae1e24b200066780fa8/style/fonts/arimo/arimo-400.latin.woff2>; as=\"font\"; crossorigin; rel=\"preload\""}
 ], #Reference<0.2513840446.3424649217.237339>}

If I edit the hackney source and force HTTP/1.0, the server will only response with one 200 response and everything will turn out ok.

I think the correct change for hackney is to throw away all 1XX response because there is no way to expose them to the caller anyway. The subsequent 2XX response is the meat the caller want.

@leonardb
Copy link
Contributor

leonardb commented Jan 3, 2022

Of interest for this: https://blog.cloudflare.com/early-hints/

Looks like these will probably become more prevalent as time goes by and should be supported asap to prevent breakage

@benoitc benoitc self-assigned this Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants