Skip to content

Commit

Permalink
fix URL
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudroques committed May 14, 2024
1 parent eafc9c4 commit 2680086
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class OldProxyServlet extends HttpServlet {
/**
* Proxy request URI regex pattern.
*/
private static final Pattern PROXY_PATTERN = Pattern.compile("/\\w+/proxy/((\\d+)/)?((\\w+)/)?(https?://.*)");
private static final Pattern PROXY_PATTERN = Pattern.compile("/\\w+/proxy/((\\d+)/)?((\\w+)/)?(https?://[^@]*)");

@Override
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ public static boolean forbiddenURL(String full) {
if (full == null) {
return true;
}
if (full.contains("@")) {
return true;
}
if (full.startsWith("https://") == false && full.startsWith("http://") == false) {
return true;
}
Expand Down

0 comments on commit 2680086

Please sign in to comment.