Skip to content

Require choice whether to use Forwarded or X-Forwarded headers #37072

Description

@rstoyanchev

Most proxies support the alternative X-Forwarded headers only. We support both the standard RFC 7239 Forwarded header, and the alternative X-Forwarded headers.

To make the behavior more deterministic, when forwarded headers are enabled, we should require a boolean choice of whether the application expects "Forwarded" or "X-Forwarded-*" headers for -proto, -host, -port, and -for, and check only the ones that are expected.

A separate property should enable support for the less common "X-Forwarded-Prefix" if needed.

We should update the documentation with more guidance on the choice of forwarded headers, and the need for proxies to handle both at the edge.

There is a related forwarded header parsing improvement #36964 that this change technically depends on given the layout of internal APIs for forwarded headers.

Metadata

Metadata

Assignees

Labels

for: upgrade-attentionAn issue requiring extra attention when upgradingin: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions