From 8d6973c876a338ad395830ecc658a24fc34d2b93 Mon Sep 17 00:00:00 2001 From: Guillaume Berche Date: Mon, 26 Oct 2020 11:00:38 +0100 Subject: [PATCH] Refine documentation on body rewrite filters for the case of missing body Null will be passed. Mono.empty() should be returned to assign an empty body. Fixes gh-2000 --- docs/src/main/asciidoc/spring-cloud-gateway.adoc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/src/main/asciidoc/spring-cloud-gateway.adoc b/docs/src/main/asciidoc/spring-cloud-gateway.adoc index 2ec47be2..14da7b9e 100644 --- a/docs/src/main/asciidoc/spring-cloud-gateway.adoc +++ b/docs/src/main/asciidoc/spring-cloud-gateway.adoc @@ -1711,6 +1711,9 @@ static class Hello { } } ---- + +NOTE: if the request has no body, the `RewriteFilter` will be passed `null`. `Mono.empty()` should be returned to assign a missing body in the request. + ==== === Modify a Response Body `GatewayFilter` Factory @@ -1734,6 +1737,8 @@ public RouteLocator routes(RouteLocatorBuilder builder) { .build(); } ---- + +NOTE: if the response has no body, the `RewriteFilter` will be passed `null`. `Mono.empty()` should be returned to assign a missing body in the response. ==== === Default Filters