You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by GitBox <gi...@apache.org> on 2021/10/13 02:22:39 UTC
[GitHub] [cxf] reta commented on a change in pull request #862: Fix not unique JAXRS method candidates WARN caused by CrossOriginResourceSharingFilter
reta commented on a change in pull request #862:
URL: https://github.com/apache/cxf/pull/862#discussion_r727647974
##########
File path: rt/rs/security/cors/src/main/java/org/apache/cxf/rs/security/cors/CrossOriginResourceSharingFilter.java
##########
@@ -290,8 +291,21 @@ private OperationResourceInfo findPreflightMethod(
String httpMethod,
MultivaluedMap<String, String> values,
Message m) {
- final String contentType = MediaType.WILDCARD;
- final MediaType acceptType = MediaType.WILDCARD_TYPE;
+ Map<String, List<String>> protocolHeaders = CastUtils.cast((Map<?, ?>)m.get(Message.PROTOCOL_HEADERS));
Review comment:
I would suggest to use `HttpHeadersImpl`:
```
final HttpHeaders headers = new HttpHeadersImpl(m);
MediaType contentType = headers.getMediaType();
if (contentType == null) {
contentType = MediaType.WILDCARD_TYPE;
}
final List<MediaType> acceptTypes = headers.getAcceptableMediaTypes();
```
(which would need to introduce `JAXRSUtils::findTargetMethod` that accepts content type as `MediaType`)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@cxf.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org