Jersey 2: Replace getHeaderValue() with getHeaderString()
ContainerRequestContext.getHeaderString() is a direct replacement for
ContainerRequest.getHeaderValue().
Reference: https://jakartaee.github.io/rest/apidocs/2.1.6/javax/ws/rs/container/ContainerRequestContext.html#getHeaderString(java.lang.String)
diff --git a/core/src/main/java/de/ids_mannheim/korap/web/filter/AuthenticationFilter.java b/core/src/main/java/de/ids_mannheim/korap/web/filter/AuthenticationFilter.java
index 0635c78..4d4a17b 100644
--- a/core/src/main/java/de/ids_mannheim/korap/web/filter/AuthenticationFilter.java
+++ b/core/src/main/java/de/ids_mannheim/korap/web/filter/AuthenticationFilter.java
@@ -45,11 +45,11 @@
@Override
public void filter (ContainerRequestContext request) {
- String host = request.getHeaderValue(ContainerRequest.HOST);
- String ua = request.getHeaderValue(ContainerRequest.USER_AGENT);
+ String host = request.getHeaderString(ContainerRequest.HOST);
+ String ua = request.getHeaderString(ContainerRequest.USER_AGENT);
String authorization =
- request.getHeaderValue(ContainerRequest.AUTHORIZATION);
+ request.getHeaderString(ContainerRequest.AUTHORIZATION);
if (authorization != null && !authorization.isEmpty()) {
TokenContext context = null;
diff --git a/core/src/main/java/de/ids_mannheim/korap/web/filter/DemoFilter.java b/core/src/main/java/de/ids_mannheim/korap/web/filter/DemoFilter.java
index 97aa875..e020a8d 100644
--- a/core/src/main/java/de/ids_mannheim/korap/web/filter/DemoFilter.java
+++ b/core/src/main/java/de/ids_mannheim/korap/web/filter/DemoFilter.java
@@ -24,7 +24,7 @@
@Override
public void filter (ContainerRequestContext request) {
String authentication =
- request.getHeaderValue(ContainerRequest.AUTHORIZATION);
+ request.getHeaderString(ContainerRequest.AUTHORIZATION);
if (authentication == null || authentication.isEmpty()) {
if (request.getSecurityContext() == null) {
request.setSecurityContext(createContext());
diff --git a/core/src/main/java/de/ids_mannheim/korap/web/filter/DemoUserFilter.java b/core/src/main/java/de/ids_mannheim/korap/web/filter/DemoUserFilter.java
index b34d4b7..f24f957 100644
--- a/core/src/main/java/de/ids_mannheim/korap/web/filter/DemoUserFilter.java
+++ b/core/src/main/java/de/ids_mannheim/korap/web/filter/DemoUserFilter.java
@@ -37,10 +37,10 @@
@Override
public void filter (ContainerRequestContext request) {
- String host = request.getHeaderValue(ContainerRequest.HOST);
- String ua = request.getHeaderValue(ContainerRequest.USER_AGENT);
+ String host = request.getHeaderString(ContainerRequest.HOST);
+ String ua = request.getHeaderString(ContainerRequest.USER_AGENT);
String authentication = request
- .getHeaderValue(ContainerRequest.AUTHORIZATION);
+ .getHeaderString(ContainerRequest.AUTHORIZATION);
// means that this is the public service
if (authentication == null || authentication.isEmpty()) {
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 6ed86b2..84d27eb 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
@@ -79,14 +79,14 @@
.queryParam("rec", "1")
//todo check for empty container
.queryParam("_cvar", translateCustomData())
- .queryParam("cip", request.getHeaderValue("Host"))
+ .queryParam("cip", request.getHeaderString("Host"))
.queryParam("cookie", "false")
.queryParam("r", String.valueOf(random.nextDouble()))
.queryParam("action_name",
request.getUriInfo().getRequestUri().toASCIIString())
.accept("text/html")
- .header("Host", request.getHeaderValue("Host"))
- .header("User-Agent", request.getHeaderValue("User-Agent"))
+ .header("Host", request.getHeaderString("Host"))
+ .header("User-Agent", request.getHeaderString("User-Agent"))
.acceptLanguage(l).method("GET");
}
catch (Exception e) {