DedupeResponseHeader GatewayFilter ファクトリ

DedupeResponseHeader GatewayFilter ファクトリは、name パラメーターとオプションの strategy パラメーターを取ります。name には、スペースで区切られたヘッダー名のリストを含めることができます。次の例では、DedupeResponseHeader GatewayFilter を構成します。

application.yml
spring:
  cloud:
    gateway:
      routes:
      - id: dedupe_response_header_route
        uri: https://example.org
        filters:
        - DedupeResponseHeader=Access-Control-Allow-Credentials Access-Control-Allow-Origin

これにより、ゲートウェイ CORS ロジックとダウンストリームロジックの両方が追加した場合に、Access-Control-Allow-Credentials および Access-Control-Allow-Origin レスポンスヘッダーの重複値が削除されます。

DedupeResponseHeader フィルターは、オプションの strategy パラメーターも受け入れます。受け入れられる値は、RETAIN_FIRST (デフォルト)、RETAIN_LASTRETAIN_UNIQUE です。