Skip to content

Commit

Permalink
Fix regression in ReactorServerHttpRequest
Browse files Browse the repository at this point in the history
Instead of a backport for cef916, this change simply undoes the
optimization that led to the regression.

Closes gh-30314
  • Loading branch information
rstoyanchev committed Apr 11, 2023
1 parent 423f221 commit 1c43a4c
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,12 @@ private static URI initUri(HttpServerRequest request) throws URISyntaxException
return new URI(resolveBaseUrl(request) + resolveRequestUri(request));
}

private static String resolveBaseUrl(HttpServerRequest request) {
private static URI resolveBaseUrl(HttpServerRequest request) throws URISyntaxException {
String scheme = request.scheme();
int port = request.hostPort();
return scheme + "://" + request.hostName() + (usePort(scheme, port) ? ":" + port : "");
return (usePort(scheme, port) ?
new URI(scheme, null, request.hostName(), port, null, null, null) :
new URI(scheme, request.hostName(), null, null));
}

private static boolean usePort(String scheme, int port) {
Expand Down

0 comments on commit 1c43a4c

Please sign in to comment.