diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/jaxrs/ResponseBuilderImpl.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/jaxrs/ResponseBuilderImpl.java index f1a546ff5c846..7b04ab947a610 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/jaxrs/ResponseBuilderImpl.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/jaxrs/ResponseBuilderImpl.java @@ -28,7 +28,7 @@ public Response.ResponseBuilder location(URI location) { try { String host = req.getRequestHost(); int port = -1; - int index = host.indexOf(":"); + int index = host.lastIndexOf(":"); if (index > -1) { port = Integer.parseInt(host.substring(index + 1)); host = host.substring(0, index); @@ -69,7 +69,7 @@ public Response.ResponseBuilder contentLocation(URI location) { try { String host = req.getRequestHost(); int port = -1; - int index = host.indexOf(":"); + int index = host.lastIndexOf(":"); if (index > -1) { port = Integer.parseInt(host.substring(index + 1)); host = host.substring(0, index); diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/jaxrs/RestResponseBuilderImpl.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/jaxrs/RestResponseBuilderImpl.java index a62003cbef6a5..43c98757afe21 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/jaxrs/RestResponseBuilderImpl.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/jaxrs/RestResponseBuilderImpl.java @@ -28,7 +28,7 @@ public RestResponse.ResponseBuilder location(URI location) { try { String host = req.getRequestHost(); int port = -1; - int index = host.indexOf(":"); + int index = host.lastIndexOf(":"); if (index > -1) { port = Integer.parseInt(host.substring(index + 1)); host = host.substring(0, index); @@ -69,7 +69,7 @@ public RestResponse.ResponseBuilder contentLocation(URI location) { try { String host = req.getRequestHost(); int port = -1; - int index = host.indexOf(":"); + int index = host.lastIndexOf(":"); if (index > -1) { port = Integer.parseInt(host.substring(index + 1)); host = host.substring(0, index);