Skip to content

Commit

Permalink
Fixed regex regression.
Browse files Browse the repository at this point in the history
  • Loading branch information
essiembre committed Aug 14, 2023
1 parent f61402a commit adf048b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/com/norconex/commons/lang/url/HttpURL.java
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ public static String getRoot(String url) {
if (StringUtils.isBlank(url)) {
return null;
}
return url.replaceFirst("^(.*?://.+?)([/?#]|$)", "$1");
return url.replaceFirst("^(.*?://[^/?#]+).*", "$1");
}

/**
Expand Down

0 comments on commit adf048b

Please sign in to comment.