spring-cloud/spring-cloud-gateway

Add CORS functionality to spring cloud gateway mvc

Open

#3.302 geöffnet am 17. März 2024

Auf GitHub ansehen
 (9 Kommentare) (4 Reaktionen) (0 zugewiesene Personen)Java (3.204 Forks)batch import
enhancementhelp wantedin: server-webmvc

Repository-Metriken

Stars
 (4.284 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 1T 21h) (18 gemergte PRs in 30 T)

Beschreibung

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

Contributor Guide