Skip to content

MultiValueHeaders and hardcoded host header extraction #211

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

Open
basharatoum opened this issue May 8, 2025 · 0 comments
Open

MultiValueHeaders and hardcoded host header extraction #211

basharatoum opened this issue May 8, 2025 · 0 comments

Comments

@basharatoum
Copy link

basharatoum commented May 8, 2025

Hello!

I think the logic within the line 118 in requestALB.go should also account for multivalueheaders!! This causes issues with https redirects! As the host header will be missing if the lambda is connected to an alb with multivalue headers included.

serverAddress := "https://" + req.Headers["host"]

Issue with redirect would look like: "https:///path" instead of "https://host/path"!!!

I know that multivalueheaders indicate the possibility of multiple values. But I think some logic should be implemented for the host header at least (take the first value).

New code to look something like:
`

host := req.Headers["host"]
if value, ok := req.MultiValueHeaders["host"]; ok && len(value) > 0 {
	host = value[0]
}

serverAddress := "https://" + host

`

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

1 participant