Closed mikeesierrah closed 2 weeks ago
This PR introduces support for the “Host” header in HTTP upgrade requests, addressing issue #1841 without disrupting the existing codebase and logic of Sing-Box.
In striving for minimal changes, I encountered a case sensitivity issue:
if headersHost := headers.Get("host"); headersHost != "" { host = headersHost }
The code functioned correctly when the key was “Host” but failed to recognize “host”: Example:
"headers": { "Host": "domain.com" }
This works, whereas:
"headers": { "host": "domain.com" }
does not.
To resolve this, I modified a few lines to ensure case-insensitive handling.
I’m open to any feedback. XD
Special thanks to @mmmray for invaluable tips and assistance.
P.S.: I believe this enhancement promotes consistency across transports and simplifies the parser development for Sing-Box.
@hiddify-com id recommend you checking this out and adding this support in your fork
This PR introduces support for the “Host” header in HTTP upgrade requests, addressing issue #1841 without disrupting the existing codebase and logic of Sing-Box.
In striving for minimal changes, I encountered a case sensitivity issue:
The code functioned correctly when the key was “Host” but failed to recognize “host”: Example:
This works, whereas:
does not.
To resolve this, I modified a few lines to ensure case-insensitive handling.
I’m open to any feedback. XD
Special thanks to @mmmray for invaluable tips and assistance.
P.S.: I believe this enhancement promotes consistency across transports and simplifies the parser development for Sing-Box.