From c362ca5b7411c8ec3b6db0adbd803ada1f8a321e Mon Sep 17 00:00:00 2001 From: ratcash Date: Tue, 9 Apr 2019 22:45:19 +0200 Subject: [PATCH] Bugfix: using getResponseHeaders() to send a response --- .../io/sinistral/proteus/server/handlers/HandlerGenerator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/io/sinistral/proteus/server/handlers/HandlerGenerator.java b/core/src/main/java/io/sinistral/proteus/server/handlers/HandlerGenerator.java index 36d5d18..4047942 100644 --- a/core/src/main/java/io/sinistral/proteus/server/handlers/HandlerGenerator.java +++ b/core/src/main/java/io/sinistral/proteus/server/handlers/HandlerGenerator.java @@ -734,7 +734,7 @@ protected void addClassMethodHandlers(TypeSpec.Builder typeBuilder, Class cla methodBuilder.addStatement("exchange.getResponseHeaders().put($T.CONTENT_TYPE, $S)", Headers.class, producesContentType); if (m.getReturnType().equals(String.class)) { - methodBuilder.addStatement("exchange.getResponseHeaders().send($L)", "response"); + methodBuilder.addStatement("exchange.getResponseSender().send($L)", "response"); } else { methodBuilder.addStatement("exchange.getResponseSender().send($L.toString())", "response"); }