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
Describe the bug
400 Bad Request error when using cloudflare tunnel, It seems that the issue is with the Host Header.
Generally, the Host matches url, but the issue is with domain containing non-ASCII characters.
In some HTTP client requests, request.URL.Host is converted to punycode for DNS lookup, but request.Host Header may not (still non-ASCII), it results url mismatch with Host Header.
However, the issue can't be fixed by editing cloudflared source code, it seems that cloudflare edge returning a 400 Bad Request due to Host header mismatch. edge doesn't forward the request to local cloudflared service, because I can't receive any log info under --loglevel debug mode.
The following log is that I mocked request by curl, and the response is 400 Bad Request:
❯ curl https://test.ᱛ.com -I -H "Host: test.ᱛ.com"
HTTP/1.1 400 Bad Request
Server: cloudflare
Date: Thu, 09 Jan 2025 06:49:13 GMT
Content-Type: text/html
Content-Length: 155
Connection: close
CF-RAY: -
If you send punycode domain in Host Header, it will work fine:
Describe the bug
400 Bad Request error when using cloudflare tunnel, It seems that the issue is with the
Host
Header.Generally, the
Host
matches url, but the issue is with domain containing non-ASCII characters.In some HTTP client requests,
request.URL.Host
is converted topunycode
for DNS lookup, butrequest.Host
Header may not (still non-ASCII), it results url mismatch with Host Header.However, the issue can't be fixed by editing cloudflared source code, it seems that cloudflare edge returning a 400 Bad Request due to
Host
header mismatch. edge doesn't forward the request to local cloudflared service, because I can't receive any log info under--loglevel debug
mode.The following log is that I mocked request by curl, and the response is 400 Bad Request:
If you send punycode domain in
Host
Header, it will work fine:To Reproduce
Steps to reproduce the behavior:
Environment and versions
The text was updated successfully, but these errors were encountered: