简体   繁体   中英

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

Spring Cloud Gateway doesn't support default filters via Beans

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM