commit | 96687245162ddb51c43f38fa18531c50fbd0c15f | [log] [tgz] |
---|---|---|
author | abcpro1 <abcpro11051@disroot.org> | Mon Nov 07 20:00:19 2022 +0000 |
committer | abcpro1 <abcpro11051@disroot.org> | Wed Nov 09 21:49:03 2022 +0000 |
tree | e48ed8b4b1f5ef0ecf254cc0f17679dbcea82a80 | |
parent | 0298407e9edfa71a00e1d7af0d6bfc5dce911fa1 [diff] |
Jersey 2: Use getUriInfo() where necessary URI related method have been moved to the UriInfo class which is returned by the method ContainerRequestContext.getUriInfo(). References: https://jakartaee.github.io/rest/apidocs/2.1.6/javax/ws/rs/container/ContainerRequestContext.html#getUriInfo() https://jakartaee.github.io/rest/apidocs/2.1.6/javax/ws/rs/core/UriInfo.html
diff --git a/core/src/main/java/de/ids_mannheim/korap/web/filter/APIVersionFilter.java b/core/src/main/java/de/ids_mannheim/korap/web/filter/APIVersionFilter.java index ecea06f..853557a 100644 --- a/core/src/main/java/de/ids_mannheim/korap/web/filter/APIVersionFilter.java +++ b/core/src/main/java/de/ids_mannheim/korap/web/filter/APIVersionFilter.java
@@ -29,7 +29,7 @@ private KustvaktConfiguration config; public void filter (ContainerRequestContext request) { - List<PathSegment> pathSegments = request.getPathSegments(); + List<PathSegment> pathSegments = request.getUriInfo().getPathSegments(); String version = pathSegments.get(0).getPath(); if (!config.getSupportedVersions().contains(version)) {
diff --git a/core/src/main/java/de/ids_mannheim/korap/web/filter/PiwikFilter.java b/core/src/main/java/de/ids_mannheim/korap/web/filter/PiwikFilter.java index 5224bd6..6ed86b2 100644 --- a/core/src/main/java/de/ids_mannheim/korap/web/filter/PiwikFilter.java +++ b/core/src/main/java/de/ids_mannheim/korap/web/filter/PiwikFilter.java
@@ -83,7 +83,7 @@ .queryParam("cookie", "false") .queryParam("r", String.valueOf(random.nextDouble())) .queryParam("action_name", - request.getRequestUri().toASCIIString()) + request.getUriInfo().getRequestUri().toASCIIString()) .accept("text/html") .header("Host", request.getHeaderValue("Host")) .header("User-Agent", request.getHeaderValue("User-Agent"))