How to return custom response from spring reactive application when the cors origin dosent match

24 Views Asked by At

Implementing WebFluxConfigurer and override addCorsMapping and add the allowedOrigins, headers and methods.

Now if a request comes on the service and origin does not meet then it automatically gives 403 Forbidden, but I want to return custom error code let say 500

how to achieve this

what I am using: -spring reactive -webFlux

I have tried extending DefaultCorsProcessor but unable to make this work as not sure how to register it.

0

There are 0 best solutions below