spring-cloud/spring-cloud-gateway

Request headers can not be modified after request pass through ModifyRequestBodyGatewayFilter

Open

#2548 aperta il 11 mar 2022

Vedi su GitHub
 (0 commenti) (0 reazioni) (0 assegnatari)Java (3204 fork)batch import
documentationhelp wanted

Metriche repository

Star
 (4284 star)
Metriche merge PR
 (Merge medio 1g 21h) (18 PR mergiate in 30 g)

Descrizione

Describe the bug Spring cloud version:3.0.3 I am using ModifyRequestBodyGatewayFilter to cache request body, but when request pass through ModifyRequestBodyGatewayFilter, heads can not be modified any more, at opposite, headers can be modified before ModifyRequestBodyGatewayFilter.

I guess this problem happened because decorate method from ModifyRequestBodyGatewayFilterFactory. Spring cloud gateway user can not get new headers from MutatedServerHttpRequest but can only get header from the time point when decorate method be called. image

I am not sure this is an issue or it's a mistake about my usage.

Guida contributor