Skip to content

Commit

Permalink
Prevent double port assignment within ApacheProxyStrategy
Browse files Browse the repository at this point in the history
Resolves: hapifhir#2856
  • Loading branch information
ZuSe committed Aug 6, 2021
1 parent 67682a8 commit 638c2a3
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,9 @@ private String forwardedServerBase(String originalServerBase,
LOG.debug("request header: {}", headers);

String host = protocol(headers) + ":https://" + forwardedHost;
String hostWithOptionalPort = port(headers).map(p -> (host + ":" + p))
.orElse(host);
String hostWithOptionalPort = port(headers).map(p ->
host.contains(":" + p) ? host : (host + ":" + p))
.orElse(host);

String path = forwardedPrefix
.orElseGet(() -> pathFrom(originalServerBase));
Expand Down

0 comments on commit 638c2a3

Please sign in to comment.