-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Open
Labels
Description
This is a re-report of #3510.
Describe the bug
The documentation for Forward Routing Filter states:
The unmodified original URL is appended to the list in the ServerWebExchangeUtils.GATEWAY_ORIGINAL_REQUEST_URL_ATTR attribute
This is not the case, or I am misunderstsanding. The controller eventually handling the request (i.e. the one being forwarded to) does not see this attribute on the ServerWebExchange.
Sample
I have attached a minimal application that recreates the behavior.
It consists roughly of:
# application.yaml
spring:
cloud:
gateway:
server:
webflux:
routes:
- id: test
uri: forward:/internal/test
predicates:
- Path=/test/**
- Method=GET@GetMapping("/internal/test")
public TestResponse test(ServerWebExchange exchange) {
Set<URI> originalUris = exchange.getAttribute(ServerWebExchangeUtils.GATEWAY_ORIGINAL_REQUEST_URL_ATTR);
return new TestResponse(true, originalUris);
}and a test expecting the response to contain a non-null originalUris value.
Reactions are currently unavailable