Merge branch '3.1.x'

This commit is contained in:
spencergibb
2022-03-21 12:48:53 -04:00
4 changed files with 89 additions and 23 deletions

View File

@@ -1143,6 +1143,29 @@ spring:
This will remove the `red` parameter before it is sent downstream.
=== `RequestHeaderSize` `GatewayFilter` Factory
The `RequestHeaderSize` `GatewayFilter` factory takes `maxSize` and `errorHeaderName` parameters.
The `maxSize` parameter is the maximum data size allowed of the request header (incuding key and value). The `errorHeaderName` parameter sets the name of the response header containing an error message, by default it is "errorMessage".
The following listing configures a `RequestHeaderSize` `GatewayFilter`:
.application.yml
====
[source,yaml]
----
spring:
cloud:
gateway:
routes:
- id: requestheadersize_route
uri: https://example.org
filters:
- RequestHeaderSize=1000B
----
====
This will send a status 431 if size of any request header is greater than 1000 Bytes.
=== The `RewritePath` `GatewayFilter` Factory
The `RewritePath` `GatewayFilter` factory takes a path `regexp` parameter and a `replacement` parameter.