Skip to content

Appending to the X-Forward-Prefix Header appends path with comma #1772

@hgarus

Description

@hgarus

I'm currently using spring-cloud gateway behind another reverse proxy. Both strip a path component and both set an X-Forwarded-Prefix header accordingly. This leads to spring-cloud-gateway appending it's path component to the existing X-Forward-Prefix Header with both components being separated by a comma.

                                                   
Client ---/a/b/c---> Proxy1 ---- /b/c -----> Proxy2 ----- /c -----> Some Service

                       X-Forwarded-Prefix: /a      X-Forwarded-Prefix: /a,/b

This breaks Spring's ForwardedHeaderFilter, since it just uses the header's content to prefix the request path. I also couldn't find any other source describing this behaviour for X-Forwarded-Prefix - MDN describes this for X-Forwarded-For.

Some form of compatibility with Spring's ForwardedHeaderFilter (and probably other implementations which assume they can just prefix a path with the contents of X-Forwarded-Prefix would be preferable to the current behavior.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions