Merge pull request #1136 from DataDog/tyler/tag-query

Capture full servlet URL in decorator
This commit is contained in:
Tyler Benson 2019-12-12 15:16:38 -08:00 committed by GitHub
commit 839de614a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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