diff --git a/docs/src/main/asciidoc/resteasy-reactive.adoc b/docs/src/main/asciidoc/resteasy-reactive.adoc index 84351d97c669a..6cd383773b930 100644 --- a/docs/src/main/asciidoc/resteasy-reactive.adoc +++ b/docs/src/main/asciidoc/resteasy-reactive.adoc @@ -1169,6 +1169,8 @@ Request filters can be declared with the `@ServerRequestFilter` annotation: [source,java] ---- +import java.util.Optional; + class Filters { @ServerRequestFilter(preMatching = true) @@ -1180,11 +1182,12 @@ class Filters { } @ServerRequestFilter - public void getFilter(ContainerRequestContext ctx) { + public Optional getFilter(ContainerRequestContext ctx) { // only allow GET methods for now if(ctx.getMethod().equals(HttpMethod.GET)) { - ctx.abortWith(Response.status(Response.Status.METHOD_NOT_ALLOWED).build()); + return Optional.of(Response.status(Response.Status.METHOD_NOT_ALLOWED).build()); } + return Optional.empty(); } } ----