Skip to content

Commit

Permalink
Merge pull request quarkusio#39046 from geoand/quarkusio#39041
Browse files Browse the repository at this point in the history
Make sure Response and RestResponse work properly with IPv6 addresses
  • Loading branch information
geoand authored Feb 28, 2024
2 parents af5b4b0 + 86fc0b2 commit 83f85d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public RestResponse.ResponseBuilder<T> 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);
Expand Down Expand Up @@ -69,7 +69,7 @@ public RestResponse.ResponseBuilder<T> 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);
Expand Down

0 comments on commit 83f85d8

Please sign in to comment.