Package io.undertow.server.handlers
Class AllowedMethodsHandler
- java.lang.Object
-
- io.undertow.server.handlers.AllowedMethodsHandler
-
- All Implemented Interfaces:
HttpHandler
public class AllowedMethodsHandler extends Object implements HttpHandler
Handler that whitelists certain HTTP methods. Only requests with a method in the allowed methods set will be allowed to continue.- Author:
- Stuart Douglas
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AllowedMethodsHandler.Builder
-
Constructor Summary
Constructors Constructor Description AllowedMethodsHandler(HttpHandler next, HttpString... allowedMethods)
AllowedMethodsHandler(HttpHandler next, Set<HttpString> allowedMethods)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<HttpString>
getAllowedMethods()
void
handleRequest(HttpServerExchange exchange)
Handle the request.String
toString()
-
-
-
Constructor Detail
-
AllowedMethodsHandler
public AllowedMethodsHandler(HttpHandler next, Set<HttpString> allowedMethods)
-
AllowedMethodsHandler
public AllowedMethodsHandler(HttpHandler next, HttpString... allowedMethods)
-
-
Method Detail
-
handleRequest
public void handleRequest(HttpServerExchange exchange) throws Exception
Description copied from interface:HttpHandler
Handle the request.- Specified by:
handleRequest
in interfaceHttpHandler
- Parameters:
exchange
- the HTTP request/response exchange- Throws:
Exception
-
getAllowedMethods
public Set<HttpString> getAllowedMethods()
-
-