package com.stubbornjava.examples.undertow.routing;

import io.undertow.server.HttpHandler;
import io.undertow.server.HttpServerExchange;
import io.undertow.util.Headers;

// {{start:handler}}
public class ConstantStringHandler implements HttpHandler {
    private final String value;
    public ConstantStringHandler(String value) {
        this.value = value;
    }

    @Override
    public void handleRequest(HttpServerExchange exchange) throws Exception {
        exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, "text/plain");
        exchange.getResponseSender().send(value);
    }
}
// {{end:handler}}
@@ -580,16 +580,23 @@
 nd(value
+ + %22%5Cn%22
 );%0A    %7D
@@ -608,16 +608,17 @@
  %7B%7Bend:handler%7D%7D
+%0A

Add newline at the end of constant string handler