Support comma-separated X-Forwarded-Port

Issue: SPR-12813
This commit is contained in:
Rossen Stoyanchev
2015-03-13 09:56:43 -04:00
parent 624790a520
commit 88a14488a1
2 changed files with 17 additions and 1 deletions

View File

@@ -297,7 +297,8 @@ public class UriComponentsBuilder implements Cloneable {
String portHeader = request.getHeaders().getFirst("X-Forwarded-Port");
if (StringUtils.hasText(portHeader)) {
port = Integer.parseInt(portHeader);
String[] ports = StringUtils.commaDelimitedListToStringArray(portHeader);
port = Integer.parseInt(ports[0]);
}
String protocolHeader = request.getHeaders().getFirst("X-Forwarded-Proto");