Capture full servlet URL in decorator

This is needed in order to tag the query string (when configured).

Full test suite will follow in future PR.
This commit is contained in:
Tyler Benson 2019-12-12 13:47:40 -08:00
parent 7b2c2e8c78
commit b00cdee54a
2 changed files with 16 additions and 2 deletions

View File

@ -28,7 +28,14 @@ public class Servlet2Decorator
@Override
protected URI url(final HttpServletRequest httpServletRequest) throws URISyntaxException {
return new URI(httpServletRequest.getRequestURL().toString());
return new URI(
httpServletRequest.getScheme(),
null,
httpServletRequest.getServerName(),
httpServletRequest.getServerPort(),
httpServletRequest.getRequestURI(),
httpServletRequest.getQueryString(),
null);
}
@Override

View File

@ -29,7 +29,14 @@ public class Servlet3Decorator
@Override
protected URI url(final HttpServletRequest httpServletRequest) throws URISyntaxException {
return new URI(httpServletRequest.getRequestURL().toString());
return new URI(
httpServletRequest.getScheme(),
null,
httpServletRequest.getServerName(),
httpServletRequest.getServerPort(),
httpServletRequest.getRequestURI(),
httpServletRequest.getQueryString(),
null);
}
@Override