diff --git a/src/main/java/io/sinistral/proteus/server/ServerResponse.java b/src/main/java/io/sinistral/proteus/server/ServerResponse.java index a1542a7..5fc276b 100644 --- a/src/main/java/io/sinistral/proteus/server/ServerResponse.java +++ b/src/main/java/io/sinistral/proteus/server/ServerResponse.java @@ -253,6 +253,12 @@ public ServerResponse throwable(Throwable throwable) return this; } + public ServerResponse status(Response.Status status) + { + this.status = status.getStatusCode(); + return this; + } + public ServerResponse status(int status) { this.status = status; diff --git a/src/main/java/io/sinistral/proteus/server/handlers/HandlerGenerator.java b/src/main/java/io/sinistral/proteus/server/handlers/HandlerGenerator.java index d0fd5d0..0c2e194 100644 --- a/src/main/java/io/sinistral/proteus/server/handlers/HandlerGenerator.java +++ b/src/main/java/io/sinistral/proteus/server/handlers/HandlerGenerator.java @@ -466,6 +466,12 @@ else if (t.equals(HttpServerExchange.class) || t.equals(ServerRequest.class)) endpointInfo.setConsumes(consumesContentType); + //The handler for these two inputs types is blocking, so we set the flag + if (endpointInfo.getConsumes().equals("application/x-www-form-urlencoded") + || endpointInfo.getConsumes().equals("multipart/form-data")) { + isBlocking = true; + } + endpointInfo.setPathTemplate(methodPath); endpointInfo.setControllerMethod(m.getName());