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: Error with version 2.0.2 when multi-value header is active in alb #910

Merged
merged 1 commit into from
Jun 19, 2024

Conversation

mbfreder
Copy link
Contributor

@mbfreder mbfreder commented Jun 19, 2024

Issue #, if available: #909

Description of changes:
Fixes bug introduced by #827
When using Lambda as target in ALB, Customers can configure either multi-value or single value headers. host header information then comes in either a singleValueHeader object or a multivalueHeaders object.
This PR adds support for both object types.

  • Fixed the getRemoteHost and getRemotePort to return the correct values for ALB.
  • Added a test to validate.

By submitting this pull request

  • I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • I confirm that I've made a best effort attempt to update all relevant documentation.

@mbfreder mbfreder requested a review from deki June 19, 2024 14:13

return request.getMultiValueHeaders().getFirst(HttpHeaders.HOST);
hostHeader = request.getMultiValueHeaders().getFirst(HttpHeaders.HOST);
return Arrays.asList(hostHeader.split(":")).get(0);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please remove the duplication, so we end up with a single return statement?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. Thanks.

@deki deki merged commit 7df3166 into aws:main Jun 19, 2024
4 checks passed
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.

None yet

2 participants