Package io.micronaut.http.filter
Interface HttpFilter
-
- All Superinterfaces:
io.micronaut.core.order.Ordered
- All Known Subinterfaces:
HttpClientFilter,HttpServerFilter
- All Known Implementing Classes:
OncePerRequestHttpServerFilter
public interface HttpFilter extends io.micronaut.core.order.OrderedA interface for classes that can intercept and filter
HttpRequestinstances and can either proceed with the request or return a modified result.Implementations are passed a
FilterChainwhere the last entry in the chain in the action to be executed that returns aPublisherthat emits anHttpResponseEach filter implements
Orderedand can return an order to increase or decrease the priority of the filterTo modify the request filters can either wrap it (using
HttpRequestWrapperor pass it along the chain as isThe response can be altered by returning an alternative
Publisherthat emits aHttpResponseor by altering the publisher returned byFilterChain.proceed(HttpRequest)- Since:
- 1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.reactivestreams.Publisher<? extends HttpResponse<?>>doFilter(HttpRequest<?> request, FilterChain chain)Intercepts aHttpRequest.
-
-
-
Method Detail
-
doFilter
org.reactivestreams.Publisher<? extends HttpResponse<?>> doFilter(HttpRequest<?> request, FilterChain chain)
Intercepts aHttpRequest.- Parameters:
request- TheHttpRequestinstancechain- TheFilterChaininstance- Returns:
- A
Publisherfor the Http response
-
-