Package io.micronaut.http.server
Class OptionsFilter
java.lang.Object
io.micronaut.http.server.OptionsFilter
- All Implemented Interfaces:
Ordered
@Requires(property="micronaut.server.dispatch-options-requests",
value="true",
defaultValue="false")
@ServerFilter("/**")
@Internal
public final class OptionsFilter
extends Object
implements Ordered
This Filter intercepts HTTP OPTIONS requests which are not CORS Preflight requests.
It responds with an OK(200) response, and it populates the Allow HTTP Header with the supported HTTP methods for the request URI.
- Since:
- 4.2.0
- Author:
- Sergio del Amo
-
Field Summary
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfilterResponse
(HttpRequest<?> request, MutableHttpResponse<?> response) int
getOrder()
-
Field Details
-
PREFIX
- See Also:
-
-
Constructor Details
-
OptionsFilter
public OptionsFilter()
-
-
Method Details
-
filterResponse
@ResponseFilter @Nullable @Internal public @Nullable HttpResponse<?> filterResponse(HttpRequest<?> request, MutableHttpResponse<?> response) -
getOrder
public int getOrder()
-