diff --git a/CHANGELOG.md b/CHANGELOG.md index ed9911d..07a7ea7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ Proteus Changelog. ## Unreleased ### No issue +**Cleanup shutdown and expose worker in request.** + + +[54979422dab4bff](https://github.com/noboomu/proteus/commit/54979422dab4bff) Joshua Bauer *2020-09-02 18:34:03* + **Set config log level to trace.** diff --git a/proteus-core/src/main/java/io/sinistral/proteus/server/ServerResponse.java b/proteus-core/src/main/java/io/sinistral/proteus/server/ServerResponse.java index ef4c6cf..5076290 100644 --- a/proteus-core/src/main/java/io/sinistral/proteus/server/ServerResponse.java +++ b/proteus-core/src/main/java/io/sinistral/proteus/server/ServerResponse.java @@ -573,8 +573,6 @@ public void send(final HttpHandler handler, final HttpServerExchange exchange) t return; } - - exchange.setStatusCode(this.status); @@ -641,6 +639,9 @@ public void send(final HttpHandler handler, final HttpServerExchange exchange) t exchange.getResponseSender().send(this.body, this.ioCallback); } } else if (hasEntity) { + + + try { if (this.processXml) { exchange.getResponseSender().send(ByteBuffer.wrap(XML_MAPPER.writeValueAsBytes(this.entity))); diff --git a/proteus-core/src/main/java/io/sinistral/proteus/server/handlers/HandlerGenerator.java b/proteus-core/src/main/java/io/sinistral/proteus/server/handlers/HandlerGenerator.java index a228ebd..b4f80f3 100644 --- a/proteus-core/src/main/java/io/sinistral/proteus/server/handlers/HandlerGenerator.java +++ b/proteus-core/src/main/java/io/sinistral/proteus/server/handlers/HandlerGenerator.java @@ -687,7 +687,7 @@ protected void addClassMethodHandlers(TypeSpec.Builder typeBuilder, Class cla methodBuilder.beginControlFlow("", ""); methodBuilder.addCode( - "$L.thenAccept( r -> r.send(this,$L) )\n\t.exceptionally( ex -> ", + "$L.thenAccept( r -> r.send(null,$L) )\n\t.exceptionally( ex -> ", "response", "exchange"); methodBuilder.beginControlFlow("", ""); methodBuilder.addCode("\t\tthrow new java.util.concurrent.CompletionException(ex);\n\t");