**[Antonio Petrelli](https://jira.spring.io/secure/ViewProfile.jspa?name=apetrelli)** opened **[SPR-16650](https://jira.spring.io/browse/SPR-16650?redirect=false)** 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 on `ServletUriComponentsBuilder`. --- **Affects:** 4.3.14 **Issue Links:** - #17105 Support for X-Forwarded-Prefix in ServletUriComponentsBuilder - #18842 ForwardedHeaderFilter could support X-Forwarded-Prefix as well - #21201 UriComponentsBuilder Forwarded header parsing can throw java.lang.NumberFormatException **Referenced from:** commits https://github.com/spring-projects/spring-framework/commit/986d219391d2e1312cccd08ea51f4a4fb5058020, https://github.com/spring-projects/spring-framework/commit/240d6f52c90fac68146bd38cea79ea6e099c6a00 **Backported to:** [4.3.15](https://github.com/spring-projects/spring-framework/milestone/164?closed=1)