Skip to content
This repository was archived by the owner on May 21, 2025. It is now read-only.
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

Description

@basharatoum

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

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions