Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
141 views
in Technique[技术] by (71.8m points)

java - Spring Gateway - Adding of default Request and Response headers

There are 2 ways to add request and response headers via a bean from RouteLocator or via properties. However would need an example to add default filters (below) via a bean as the service-response-value and service-request-value would be a dynamic value :

spring
  cloud:
    gateway:
      default-filters:
        - AddRequestHeader= service-request, service-request-value
        - AddResponseHeader= service-response, service-response-value
question from:https://stackoverflow.com/questions/65846586/spring-gateway-adding-of-default-request-and-response-headers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Spring Cloud Gateway doesn't support default filters via Beans

https://github.com/spring-cloud/spring-cloud-gateway/issues/263


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...