W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗(yàn)值獎勵
RewriteResponseHeader
GatewayFilter工廠采用name
,regexp
和replacement
參數(shù)。它使用Java正則表達(dá)式以靈活的方式重寫響應(yīng)標(biāo)頭值。
application.yml。
spring: cloud: gateway: routes: - id: rewriteresponseheader_route uri: https://example.org filters: - RewriteResponseHeader=X-Response-Foo, , password=[^&]+, password=***
對于標(biāo)頭值為/42?user=ford&password=omg!what&flag=true
,在發(fā)出下游請求后它將被設(shè)置為/42?user=ford&password=***&flag=true
。由于YAML規(guī)范,請使用$\
來表示$
。
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: