jepsar opened a new issue, #953:
URL: https://github.com/apache/shiro/issues/953

   It would be nice if there was native (optional) support to always grant 
access to preflight requests.
   
   https://developer.mozilla.org/en-US/docs/Glossary/Preflight_request
   
   In our JAX RS project, we added this to our filter:
   
   ```java
     @Override
     protected boolean isAccessAllowed(ServletRequest request, ServletResponse 
response, Object mappedValue) {
       if (isPreflightRequest(request)) {
         return true;
       }
       return super.isAccessAllowed(request, response, mappedValue);
     }
   
     protected boolean isPreflightRequest(ServletRequest request) {
       HttpServletRequest httpRequest = WebUtils.toHttp(request);
       return httpRequest.getHeader("Origin") != null && 
httpRequest.getMethod().equals("OPTIONS");
     }
   ```


-- 
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: issues-unsubscr...@shiro.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@shiro.apache.org
For additional commands, e-mail: issues-h...@shiro.apache.org

Reply via email to