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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to