Replaces rather than prepend contextPath

Issue: SPR-16650
This commit is contained in:
Rossen Stoyanchev
2018-03-29 18:16:25 -04:00
parent d553ddc5b3
commit 240d6f52c9
3 changed files with 92 additions and 21 deletions

View File

@@ -724,6 +724,11 @@ public class UriComponentsBuilder implements UriBuilder, Cloneable {
* "Forwarded" (<a href="http://tools.ietf.org/html/rfc7239">RFC 7239</a>,
* or "X-Forwarded-Host", "X-Forwarded-Port", and "X-Forwarded-Proto" if
* "Forwarded" is not found.
* <p><strong>Note:</strong> this method uses values from forwarded headers,
* if present, in order to reflect the client-originated protocol and address.
* Consider using the {@code ForwardedHeaderFilter} in order to choose from a
* central place whether to extract and use, or to discard such headers.
* See the Spring Framework reference for more on this filter.
* @param headers the HTTP headers to consider
* @return this UriComponentsBuilder
* @since 4.2.7