Skip to content

Commit

Permalink
Merge pull request #5 from SeanMollet/master
Browse files Browse the repository at this point in the history
Set isBlocking true if the input type uses a handler that blocks.
  • Loading branch information
noboomu authored Oct 3, 2018
2 parents 52702bd + c28771d commit 7e481ec
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/io/sinistral/proteus/server/ServerResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,12 @@ public ServerResponse<T> throwable(Throwable throwable)
return this;
}

public ServerResponse<T> status(Response.Status status)
{
this.status = status.getStatusCode();
return this;
}

public ServerResponse<T> status(int status)
{
this.status = status;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 7e481ec

Please sign in to comment.