Fixing docs

This commit is contained in:
Ryan Baxter
2023-12-05 11:46:52 -05:00
parent 3eae3ea8b4
commit 7c275f59b8
2 changed files with 20 additions and 1 deletions

View File

@@ -1,10 +1,12 @@
[[redirectto-gatewayfilter-factory]]
= `RedirectTo` `GatewayFilter` Factory
The `RedirectTo` `GatewayFilter` factory takes two parameters, `status` and `url`.
The `RedirectTo` `GatewayFilter` factory takes three parameters, `status`, `url`, and optionally `includeRequestParams`.
The `status` parameter should be a 300 series redirect HTTP code, such as 301.
The `url` parameter should be a valid URL.
This is the value of the `Location` header.
The `includeRequestParams` parameter indicates whether request query parameters should be included on the `url`.
When not set, it will be treated as `false`.
For relative redirects, you should use `uri: no://op` as the uri of your route definition.
The following listing configures a `RedirectTo` `GatewayFilter`:
@@ -23,4 +25,20 @@ spring:
This will send a status 302 with a `Location:https://acme.org` header to perform a redirect.
The following example configures a `RedirectTo` `GatewayFilter` with `includeRequestParams` set to `true`.
.application.yml
[source,yaml]
----
spring:
cloud:
gateway:
routes:
- id: prefixpath_route
uri: https://example.org
filters:
- RedirectTo=302, https://acme.org, true
----
When a request with query `?skip=10` is made to the gateway, the gateway will send a status 302 with a
`Location:https://acme.org?skip=10` header to perform a redirect.

View File

@@ -309,6 +309,7 @@
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>