spring-cloud/spring-cloud-gateway

Add CORS functionality to spring cloud gateway mvc

Open

Aperta il 17 mar 2024

Vedi su GitHub
 (9 commenti) (4 reazioni) (0 assegnatari)Java (4284 star) (3204 fork)batch import
enhancementhelp wantedin: server-webmvc

Descrizione

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

Guida contributor