Skip to content

Commit 4aa7c08

Browse files
tungjspencergibb
authored andcommitted
Fix example code to compile
Fixes gh-3427
1 parent 4676b39 commit 4aa7c08

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/modules/ROOT/pages/spring-cloud-gateway-server-mvc/writing-custom-predicates-and-filters.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ import org.springframework.web.servlet.function.ServerResponse;
9494
class SampleHandlerFilterFunctions {
9595
public static HandlerFilterFunction<ServerResponse, ServerResponse> instrument(String requestHeader, String responseHeader) {
9696
return (request, next) -> {
97-
ServerRequest modified = ServerRequest.from(request).header(requestHeader, generateId());
97+
ServerRequest modified = ServerRequest.from(request).header(requestHeader, generateId()).build();
9898
ServerResponse response = next.handle(modified);
9999
response.headers().add(responseHeader, generateId());
100100
return response;
@@ -147,7 +147,7 @@ import org.springframework.web.servlet.function.ServerRequest;
147147
148148
class SampleBeforeFilterFunctions {
149149
public static Function<ServerRequest, ServerRequest> instrument(String header) {
150-
return request -> ServerRequest.from(request).header(header, generateId());;
150+
return request -> ServerRequest.from(request).header(header, generateId()).build();
151151
}
152152
}
153153
----

0 commit comments

Comments
 (0)