From aadae7b6e609a394fb6458aaba3fcaa5ea10a638 Mon Sep 17 00:00:00 2001 From: Sean Mollet Date: Tue, 2 Oct 2018 12:34:23 -0500 Subject: [PATCH 1/2] Set isBlocking true if the input type uses a handler that blocks. --- .../sinistral/proteus/server/handlers/HandlerGenerator.java | 6 ++++++ 1 file changed, 6 insertions(+) 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()); From c28771d7757f44b0e7dca022f92ad20fd5316c8c Mon Sep 17 00:00:00 2001 From: Sean Mollet Date: Tue, 2 Oct 2018 16:16:02 -0500 Subject: [PATCH 2/2] Added Enum option to status set on ServerResponse. --- .../java/io/sinistral/proteus/server/ServerResponse.java | 6 ++++++ 1 file changed, 6 insertions(+) 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;