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

Fix go1.20.6 host header for unix sockets #13

Merged
merged 2 commits into from
Jul 13, 2023
Merged

Conversation

cpuguy83
Copy link
Owner

go1.20.6 made a security-related patch to header parsing that makes a
path in the host header invalid.
This breaks unix sockets (and probably named pipes on Windows).

This change sets the req.Host field to override the host header field
to a value go is happy with.
Namely it just replaces all instances of / with _

Fixes #12

cpuguy83 added 2 commits July 13, 2023 16:06
go1.20.6 made a security-related patch to header parsing that makes a
path in the host header invalid.
This breaks unix sockets (and probably named pipes on Windows).

This change sets the `req.Host` field to override the host header field
to a value go is happy with.
Namely it just replaces all instances of `/` with `_`

Signed-off-by: Brian Goff <[email protected]>
This was supposed to happen in a defer.
Otherwise `retErr` is always nil.

Signed-off-by: Brian Goff <[email protected]>
@cpuguy83 cpuguy83 merged commit 66f6255 into master Jul 13, 2023
@cpuguy83 cpuguy83 deleted the fix_host_header branch July 13, 2023 16:11
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

Successfully merging this pull request may close these issues.

Go 1.20.6 bug http: invalid Host header
1 participant