You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the Host header is always sent last because it is added automatically on wpull.protocol.http.request.Request.prepare_for_send after the other headers were already set. I propose to change this to always send the Host header line first.
Theoretically, this shouldn't matter. The order of header lines is not significant in HTTP. From RFC 7230 section 3.2.2:
The order in which header fields with differing field names are
received is not significant. However, it is good practice to send
header fields that contain control data first, such as Host on
requests and Date on responses, so that implementations can decide
when not to handle a message as early as possible.
Unfortunately, it appears that Cloudflare is (since recently?) treating requests where the Host header doesn't come first differently.
Example of different header order producing different results on Cloudflare with curl
-H 'Host:' -H 'Host: bund.lkr.de' first removes the header and then adds it again, forcing it to be at the end. The 307 is the expected response for this site, the 503 is the Cloudflare JS challenge.
The text was updated successfully, but these errors were encountered:
Currently, the
Host
header is always sent last because it is added automatically onwpull.protocol.http.request.Request.prepare_for_send
after the other headers were already set. I propose to change this to always send theHost
header line first.Theoretically, this shouldn't matter. The order of header lines is not significant in HTTP. From RFC 7230 section 3.2.2:
Unfortunately, it appears that Cloudflare is (since recently?) treating requests where the
Host
header doesn't come first differently.Example of different header order producing different results on Cloudflare with curl
-H 'Host:' -H 'Host: bund.lkr.de'
first removes the header and then adds it again, forcing it to be at the end. The 307 is the expected response for this site, the 503 is the Cloudflare JS challenge.The text was updated successfully, but these errors were encountered: