Adds remove request param filter.

This removes a request parameter before sending downstream request.

Fixes gh-1137
This commit is contained in:
Thirunavukkarasu Ravichandran
2019-07-14 09:35:09 +02:00
committed by Spencer Gibb
parent 0501c7a1c8
commit c8a693b50a
6 changed files with 308 additions and 0 deletions

View File

@@ -803,6 +803,24 @@ To remove any kind of sensitive header you should configure this filter for any
want to do so. In addition you can configure this filter once using `spring.cloud.gateway.default-filters`
and have it applied to all routes.
=== RemoveRequestParameter GatewayFilter Factory
The RemoveRequestParameter GatewayFilter Factory takes a `name` parameter. It is the name of the query parameter to be removed.
.application.yml
[source,yaml]
----
spring:
cloud:
gateway:
routes:
- id: removerequestparameter_route
uri: https://example.org
filters:
- RemoveRequestParameter=foo
----
This will remove the `foo` parameter before it is sent downstream.
=== RewritePath GatewayFilter Factory
The RewritePath GatewayFilter Factory takes a path `regexp` parameter and a `replacement` parameter. This uses Java regular expressions for a flexible way to rewrite the request path.