public class ForwardedHeaderFilter extends java.lang.Object implements WebFilter
HttpRequest.getURI()
.
In effect the request URI will reflect the client-originated
protocol and address.
Note: This filter can also be used in a
removeOnly
mode where "Forwarded" and "X-Forwarded-*"
headers are only eliminated without being used.
Constructor and Description |
---|
ForwardedHeaderFilter() |
Modifier and Type | Method and Description |
---|---|
reactor.core.publisher.Mono<java.lang.Void> |
filter(ServerWebExchange exchange,
WebFilterChain chain)
Process the Web request and (optionally) delegate to the next
WebFilter through the given WebFilterChain . |
void |
setRemoveOnly(boolean removeOnly)
Enables mode in which any "Forwarded" or "X-Forwarded-*" headers are
removed only and the information in them ignored.
|
public void setRemoveOnly(boolean removeOnly)
removeOnly
- whether to discard and ignore forwarded headerspublic reactor.core.publisher.Mono<java.lang.Void> filter(ServerWebExchange exchange, WebFilterChain chain)
WebFilter
WebFilter
through the given WebFilterChain
.