handle null request uris

This commit is contained in:
fjy 2014-04-17 18:13:03 -07:00
parent 1fcb3e01c3
commit a520a2dde0
1 changed files with 5 additions and 4 deletions

View File

@ -371,13 +371,14 @@ public class AsyncQueryForwardingServlet extends HttpServlet
}
}
private String makeUrl(String host, HttpServletRequest req)
private String makeUrl(final String host, final HttpServletRequest req)
{
String queryString = req.getQueryString();
final String queryString = req.getQueryString();
final String requestURI = req.getRequestURI() == null ? "" : req.getRequestURI();
if (queryString == null) {
return String.format("http://%s%s", host, req.getRequestURI());
return String.format("http://%s%s", host, requestURI);
}
return String.format("http://%s%s?%s", host, req.getRequestURI(), req.getQueryString());
return String.format("http://%s%s?%s", host, requestURI, queryString);
}
}