UriComponentsBuilder.fromHttpRequest sets port correctly

Issue: SPR-12771
This commit is contained in:
Rossen Stoyanchev
2015-03-05 21:52:27 -05:00
parent 7bc44a9086
commit d64c48ff5f
3 changed files with 40 additions and 3 deletions

View File

@@ -307,6 +307,7 @@ public class UriComponentsBuilder implements Cloneable {
builder.scheme(scheme);
builder.host(host);
builder.port(null);
if (scheme.equals("http") && port != 80 || scheme.equals("https") && port != 443) {
builder.port(port);
}