Skip to content
Snippets Groups Projects
Commit 6c3bb895 authored by Thomas Mortagne's avatar Thomas Mortagne
Browse files

XWIKI-22394: When accessing directly Tomcat, the resolved source URL can contain an extra port

* bulletproofing for tests

(cherry picked from commit 50e1c84c)
parent d73982cb
No related branches found
No related tags found
No related merge requests found
......@@ -193,8 +193,9 @@ private static void appendHostPort(HttpServletRequest request, StringBuilder bui
// Ask the application server (we don't start with that because it's very often wrong or badly configured
// behind an HTTP proxy...)
String requestURLString = request.getRequestURL().toString();
if (!requestURLString.isEmpty()) {
StringBuffer buffer = request.getRequestURL();
if (buffer != null && !buffer.isEmpty()) {
String requestURLString = buffer.toString();
try {
URL requestURL = new URL(requestURLString);
builder.append(requestURL.getHost());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment