Skip to content

Commit

Permalink
Fail to deploy application when http and https ports are the same
Browse files Browse the repository at this point in the history
Vert.x seems not thrown any exception in this scenario, but it then
throws NPEs in either the secure or insecure handling of requests.
This behavior is very odd and provides users no good ways of diagnosing
the problem

Closes: #39289
  • Loading branch information
geoand committed Mar 11, 2024
1 parent 0dc9a58 commit b0c8c09
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1187,8 +1187,10 @@ public void handle(AsyncResult<HttpServer> event) {

if (https) {
actualHttpsPort = actualPort;
validateHttpPorts(actualHttpPort, actualHttpsPort);
} else {
actualHttpPort = actualPort;
validateHttpPorts(actualHttpPort, actualHttpsPort);
}
if (actualPort != options.getPort()) {
// Override quarkus.http(s)?.(test-)?port
Expand Down Expand Up @@ -1220,6 +1222,12 @@ public void handle(AsyncResult<HttpServer> event) {

}
}

private static void validateHttpPorts(int httpPort, int httpsPort) {
if (httpsPort == httpPort) {
throw new IllegalArgumentException("Both http and https servers started on port " + httpPort);
}
}
});
}

Expand Down

0 comments on commit b0c8c09

Please sign in to comment.