Skip to content
This repository was archived by the owner on May 21, 2025. It is now read-only.

MultiValueHeaders and hardcoded host header extraction #211

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant