spring-cloud/spring-cloud-gateway

ProxyExchange discards all incoming request headers when making a request with a body.

Aberta

#2.559 aberto em 16 de mar. de 2022

 (3 comentários) (2 reações) (0 responsável)Java (3.204 forks)batch import
bughelp wanted

Métricas do repositório

Stars
 (4.284 estrelas)
Métricas de merge de PR
 (Mesclagem média 1d 21h) (18 fundiu PRs em 30d)

Description

Affects: spring-cloud-gateway-webflux:3.1.1


Setup Define an MVC RestController that accepts a ProxyExchange as an argument to a request handler method, and use the ProxyExchange object to issue a POST request (or any request that contains a body) to an upstream service, using a body created (or manipulated) in the request handler method.

Expected Behaviour The ProxyExchange forwards the original request headers, minus filtered sensitive headers, and Content related headers in the upstream request.

Observed Behaviour The ProxyExchange discards all original incoming headers, appending only the X-Forwarded-For and X-Forwarded-Proto headers. This behaviour is in contrast to the behaviour observed when using a ProxyExchange object to make requests to upstream services that do not contain bodies (GET, OPTIONS, etc).

Guia do colaborador