public Response handleRequest(Message m, ClassResourceInfo resourceClass) { OperationResourceInfo opResInfo = m.getExchange().get(OperationResourceInfo.class); CrossOriginResourceSharing annotation = opResInfo == null ? null : getAnnotation(opResInfo.getAnnotatedMethod(), CrossOriginResourceSharing.class); if ("OPTIONS".equals(m.get(Message.HTTP_REQUEST_METHOD))) { return preflightRequest(m, annotation, opResInfo, resourceClass); } return simpleRequest(m, annotation); }
@Override public void filter(ContainerRequestContext context) { Message m = JAXRSUtils.getCurrentMessage(); String httpMethod = (String)m.get(Message.HTTP_REQUEST_METHOD); if (HttpMethod.OPTIONS.equals(httpMethod)) { Response r = preflightRequest(m); if (r != null) { context.abortWith(r); } } else if (findResourceMethod) { Method method = getResourceMethod(m, httpMethod); simpleRequest(m, method); } else { m.getInterceptorChain().add(new CorsInInterceptor()); } }
@Override public void filter(ContainerRequestContext context) { Message m = JAXRSUtils.getCurrentMessage(); String httpMethod = (String)m.get(Message.HTTP_REQUEST_METHOD); if (HttpMethod.OPTIONS.equals(httpMethod)) { Response r = preflightRequest(m); if (r != null) { context.abortWith(r); } } else if (findResourceMethod) { Method method = getResourceMethod(m, httpMethod); simpleRequest(m, method); } else { m.getInterceptorChain().add(new CorsInInterceptor()); } }