-
Notifications
You must be signed in to change notification settings - Fork 580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider logging a warning if @CrossOrigin is on a non-OPTIONS method (or revise existing error message) #3655
Comments
It could even be a fatal error at startup or during annotation processing I suppose. |
@AbhideepChakravarty Are you not using CORS at all? If not, you should be able to exclude it from you classpath I suppose. |
@AbhideepChakravarty Some quick testing shows that in order to get that exception in the logs the following conditions likely hold:
For (3), Helidon checks if ORIGIN is absent or if present that it contains the same info as the HOST header (sort of). Perhaps you can share the request that is triggering the exception for further analysis. |
@AbhideepChakravarty Any chance you can share more info about that request? |
I got the issue. I need up with http method on the client side and created mess. When I corrected things, everything worked fine. But I am not yet sure what was the root cause of the problem. As the original post, a warning it critical error would help, if given with proper reason. |
@AbhideepChakravarty As explained above, I think somehow your requests included an |
Sure we can do that. If we can find a way to reproduce it and document it properly, we should open it. |
The original purpose of the issue remains - warning or failing during start-up if the developer has placed a |
Environment Details
Problem Description
We ask Helidon MP app developers to CORS-enable their endpoints by adding
@CrossOrigin
annotations to@OPTIONS
methods on their JAX-RS resource classes. If they incorrectly add the annotation to the non-OPTIONS endpoints, Helidon logs a mysterious error:This error could occur in other circumstances, but developers typically see it if they have annotated the wrong method.
Although our doc is pretty clear, it might be worth adding a runtime warning if developers have misplaced the
@CrossOrigin
annotation.Steps to reproduce
TBD
The text was updated successfully, but these errors were encountered: