Skip to content

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
Contributor

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
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.

2 participants