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"); }