feat(elbv2): honor preserve_host_header parameter - #2109
Conversation
|
🎉 Thanks for your first pull request to Floci! Your CI checks need a maintainer to approve them before they run. That is GitHub's standard gate on first-time contributors, not a problem with your PR — so if the checks look like they are doing nothing, that is why. Once a maintainer approves, CI and the compatibility suite start automatically. Nothing is needed from you in the meantime. While you wait, a couple of things that make review faster:
Come join us in Slack — it is the fastest way to reach maintainers if you get stuck, or want feedback on an approach before investing more time in it. |
|
| Filename | Overview |
|---|---|
| src/main/java/io/github/hectorvent/floci/services/elbv2/ElbV2DataPlane.java | Propagates listener ownership into forwarding and conditionally retains the inbound Host header based on the live load-balancer attribute. |
| src/test/java/io/github/hectorvent/floci/services/elbv2/ElbV2PreserveHostHeaderIntegrationTest.java | Adds an integration test proving default target-host forwarding and immediate client-host preservation after enabling the attribute. |
Sequence Diagram
sequenceDiagram
participant Client
participant DataPlane as ELBv2 Data Plane
participant Service as ELBv2 Service
participant Backend
Client->>DataPlane: Request with original Host
DataPlane->>Service: Read load-balancer attributes
Service-->>DataPlane: preserve_host_header value
alt Preservation enabled
DataPlane->>Backend: Forward with original Host
else Preservation disabled
DataPlane->>Backend: Forward with target Host
end
Backend-->>DataPlane: Response
DataPlane-->>Client: Proxied response
Reviews (1): Last reviewed commit: "feat(elbv2): honor preserve_host_header ..." | Re-trigger Greptile
Summary
Hello!
This PR updates the ELBv2 service to honor the
preserve_host_headerparameter.It propagates the load balancer's ARN through the ElbV2DataPlane instance in order to retrieve the current value of
routing.http.preserve_host_header.enabledinexecuteForward/proxyRequestType of change
fix:)feat:)feat!:orfix!:)AWS Compatibility
Change tested with a simple echo server running on ECS behind an ALB.
Stack deployed through terraform with hashicorp/aws 6.57.1.
Without the patch/with
preserve_host_header=false:With the patch +
preserve_host_header=true:Checklist
./mvnw testpasses locally