ServletUriComponentsBuilder should replace context path when X-Forwarded-Prefix is present [SPR-16650] #21191
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: backported
An issue that has been backported to maintenance branches
type: bug
A general bug
Milestone
Antonio Petrelli opened SPR-16650 and commented
ServletUriComponentsBuilder.fromContextPath
, if the X-Forwarded-Prefix header is present, prepends the header value to the context path.It should, instead, replace it, since this is what ForwardedHeaderFilter does.
In my case I see URLs in Spring Data Rest results are affected.
Workaround: use
ForwardedHeaderFilter
instead of relying onServletUriComponentsBuilder
.Affects: 4.3.14
Issue Links:
Referenced from: commits 986d219, 240d6f5
Backported to: 4.3.15
The text was updated successfully, but these errors were encountered: