-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Micronaut Cors does not work as expected when we define custom HttpServerFilters #10869
Comments
this sounds like you have the filter ordering incorrect |
@graemerocher thanks for quick reply. Is Cors filter of highest precedence? As per cors filter code in Micronaut. I believe it is returning a response decorated with preflight headers if status is < 400.
Can cors filter ever proceed with chain request if options preflight request succeeded and land into custom authorization filter and still fail there? |
@graemerocher can you please suggest how can I fix the ordering so that cors filter runs first? |
Add an order to your own filter that is higher than that of the cors filter, which should be 9250 |
@yawkat
But overriding the method getOrder works
|
Hey any updates here? |
Expected Behavior
OPTIONS preflight request should not fail
Actual Behaviour
OPTIONS preflight request fails
Steps To Reproduce
curl:
Response:
![Screenshot 2024-05-31 at 12 12 09 PM](https://private-user-images.githubusercontent.com/17374605/335470762-6a6b0ec5-5d1e-4c59-8282-3a070897f132.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI0Njc5OTcsIm5iZiI6MTcyMjQ2NzY5NywicGF0aCI6Ii8xNzM3NDYwNS8zMzU0NzA3NjItNmE2YjBlYzUtNWQxZS00YzU5LTgyODItM2EwNzA4OTdmMTMyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MzElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzMxVDIzMTQ1N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE5YzVhMjFlM2VkY2YxMmQyZTEzNjdhNDg4MzRhZjFhNWJmYWMwMGI4MDNiYTc4YTJkNGYxNDgzNTZlOGViYjImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.ClLDVguM7Ea6vEp4-WiHMDbXrihpB9uKLt10dQeZxMI)
Environment Information
Micronaut: 3.7.2
Language: Kotlin
Example Application
No response
Version
3.7.2
The text was updated successfully, but these errors were encountered: