Skip to content

Commit 7c275f5

Browse files
committed
Fixing docs
1 parent 3eae3ea commit 7c275f5

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

docs/modules/ROOT/pages/spring-cloud-gateway/gatewayfilter-factories/redirectto-factory.adoc

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
[[redirectto-gatewayfilter-factory]]
22
= `RedirectTo` `GatewayFilter` Factory
33

4-
The `RedirectTo` `GatewayFilter` factory takes two parameters, `status` and `url`.
4+
The `RedirectTo` `GatewayFilter` factory takes three parameters, `status`, `url`, and optionally `includeRequestParams`.
55
The `status` parameter should be a 300 series redirect HTTP code, such as 301.
66
The `url` parameter should be a valid URL.
77
This is the value of the `Location` header.
8+
The `includeRequestParams` parameter indicates whether request query parameters should be included on the `url`.
9+
When not set, it will be treated as `false`.
810
For relative redirects, you should use `uri: no://op` as the uri of your route definition.
911
The following listing configures a `RedirectTo` `GatewayFilter`:
1012

@@ -23,4 +25,20 @@ spring:
2325

2426
This will send a status 302 with a `Location:https://acme.org` header to perform a redirect.
2527

28+
The following example configures a `RedirectTo` `GatewayFilter` with `includeRequestParams` set to `true`.
2629

30+
.application.yml
31+
[source,yaml]
32+
----
33+
spring:
34+
cloud:
35+
gateway:
36+
routes:
37+
- id: prefixpath_route
38+
uri: https://example.org
39+
filters:
40+
- RedirectTo=302, https://acme.org, true
41+
----
42+
43+
When a request with query `?skip=10` is made to the gateway, the gateway will send a status 302 with a
44+
`Location:https://acme.org?skip=10` header to perform a redirect.

spring-cloud-gateway-server/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@
309309
</plugin>
310310
<plugin>
311311
<groupId>org.apache.maven.plugins</groupId>
312+
<artifactId>maven-jar-plugin</artifactId>
312313
<version>3.3.0</version>
313314
<executions>
314315
<execution>

0 commit comments

Comments
 (0)