Merge remote-tracking branch 'MSTR/3.x' into 3.1.2.a
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/AbstractMethodSelectingRouter.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/AbstractMethodSelectingRouter.java index 76e96aa..6416ed4 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/AbstractMethodSelectingRouter.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/AbstractMethodSelectingRouter.java
@@ -201,10 +201,10 @@ /** * Determines whether this {@code ConsumesProducesAcceptor} router can process the {@code request}. * - * @param requestContext The request to be tested. + * @param contentType The media type of the {@code request} to be tested (can be NULL). * @return True if the {@code request} can be processed by this router, false otherwise. */ - abstract boolean isConsumable(ContainerRequest requestContext); + abstract boolean isConsumable(MediaType contentType); @Override public String toString() { @@ -400,8 +400,8 @@ final List<ConsumesProducesAcceptor> satisfyingAcceptors = new LinkedList<>(); final Set<ResourceMethod> differentInvokableMethods = Collections.newSetFromMap(new IdentityHashMap<>()); final MediaType requestContentType = request.getMediaType(); - for (ConsumesProducesAcceptor cpi : acceptors) { - if (cpi.isConsumable(request)) { + for (final ConsumesProducesAcceptor cpi : acceptors) { + if (cpi.isConsumable(requestContentType)) { satisfyingAcceptors.add(cpi); differentInvokableMethods.add(cpi.methodRouting.method); }
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/OctetStreamMethodSelectingRouter.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/OctetStreamMethodSelectingRouter.java index 47b30a8..c7cc880 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/OctetStreamMethodSelectingRouter.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/OctetStreamMethodSelectingRouter.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -65,11 +65,11 @@ /** * Determines whether this {@code ConsumesProducesAcceptor} router can process the {@code request}. * - * @param requestContext The request to be tested. + * @param contentType The media type of the {@code request} to be tested (can be NULL). * @return True if the {@code request} can be processed by this router, false otherwise. */ - boolean isConsumable(ContainerRequest requestContext) { - MediaType contentType = requestContext.getMediaType(); + @Override + boolean isConsumable(MediaType contentType) { if (contentType == null && methodRouting.method.getType() != ResourceMethod.JaxrsType.SUB_RESOURCE_LOCATOR && methodRouting.method.getInvocable().requiresEntity()) { contentType = MediaType.APPLICATION_OCTET_STREAM_TYPE;
diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/WildcardMethodSelectingRouter.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/WildcardMethodSelectingRouter.java index c9f2e49..6559d33 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/WildcardMethodSelectingRouter.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/routing/WildcardMethodSelectingRouter.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -68,11 +68,11 @@ /** * Determines whether this {@code ConsumesProducesAcceptor} router can process the {@code request}. * - * @param requestContext The request to be tested. + * @param contentType The media type of the {@code request} to be tested (can be NULL). * @return True if the {@code request} can be processed by this router, false otherwise. */ - boolean isConsumable(ContainerRequest requestContext) { - MediaType contentType = requestContext.getMediaType(); + @Override + boolean isConsumable(MediaType contentType) { return contentType == null || consumes.getMediaType().isCompatible(contentType); } }
diff --git a/ext/spring6/pom.xml b/ext/spring6/pom.xml index 3566d36..6e871bf 100644 --- a/ext/spring6/pom.xml +++ b/ext/spring6/pom.xml
@@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Copyright (c) 2012, 2022 Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2012, 2023 Oracle and/or its affiliates. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/tests/integration/jersey-5087/pom.xml b/tests/integration/jersey-5087/pom.xml index b9ad43d..ba590c3 100644 --- a/tests/integration/jersey-5087/pom.xml +++ b/tests/integration/jersey-5087/pom.xml
@@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2022, 2023 Oracle and/or its affiliates. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v. 2.0, which is available at