Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -386,12 +386,14 @@ private URI buildLivenessUri(int livenessCheckPort) {
final String scheme = (tlsEnabled ? "https" : "http") + "://";
final String host = waitStrategyTarget.getHost();

final String portSuffix;
if ((tlsEnabled && 443 == livenessCheckPort) || (!tlsEnabled && 80 == livenessCheckPort)) {
portSuffix = "";
} else {
portSuffix = ":" + livenessCheckPort;
}
// Always render the port explicitly. Dropping the default port
// (80/443) is only valid when host:<port> really is the mapped
// service, which cannot be assumed here (custom WaitStrategyTarget
// implementations, proxied environments, ...). An explicit port is
// also what the "un-map the port for logging" path above relies on:
// URI.getPort() returns -1 when the port is elided, which breaks the
// exposed-port lookup.
final String portSuffix = ":" + livenessCheckPort;

return URI.create(scheme + host + portSuffix + path);
}
Expand Down
Loading