Add CORS functionality to spring cloud gateway mvc
I required cross origin functionality in spring gateway mvc but I am not able to use it E.g This metadata is not present in spring gateway mvc.
spring:
cloud:
gateway:
routes:
- id: cors_route
uri: https://example.org
predicates:
- Path=/service/**
metadata:
cors
allowedOrigins: '*'
allowedMethods:
- GET
- POST
allowedHeaders: '*'
maxAge: 30
Hi @spencergibb Do there will be update in next version release? can you provide some solution or work around for time being? Because I am stuck with this now.
It can be in the next minor, but that will not be until November. In the meantime, you might be able to use normal Spring Boot configuration https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#web.servlet.spring-mvc.cors and https://docs.spring.io/spring-framework/reference/web/webmvc-cors.html
@spencergibb I would be happy to contribute in this with some guidance. I pinged you on Twitter about this feature because I really need it. Thank you
PRs welcome