Skip to content

Commit

Permalink
Merge pull request #39318 from geoand/#39289
Browse files Browse the repository at this point in the history
Fail to deploy application when http and https ports are the same
  • Loading branch information
geoand authored Mar 11, 2024
2 parents 68f1c90 + 21adee6 commit 04358cb
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 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 04358cb

Please sign in to comment.