@@ -0,0 +1,1699 @@
+package com.networknt.content;%0A%0Aimport com.networknt.config.Config;%0Aimport com.networknt.handler.MiddlewareHandler;%0Aimport com.networknt.utility.ModuleRegistry;%0Aimport io.undertow.Handlers;%0Aimport io.undertow.server.HttpHandler;%0Aimport io.undertow.server.HttpServerExchange;%0Aimport io.undertow.util.Headers;%0A%0A/**%0A * Created by Ricardo Pina Arellano on 13/06/18.%0A */%0Apublic class ContentHandler implements MiddlewareHandler %7B%0A%0A  public static final String CONFIG_NAME = %22content%22;%0A%0A  public static final ContentConfig config = (ContentConfig) Config.getInstance().getJsonObjectConfig(CONFIG_NAME, ContentConfig.class);%0A%0A  private static final String contentType = config.getContentType();%0A%0A  private volatile HttpHandler next;%0A%0A  public ContentHandler() %7B %7D%0A%0A  @Override%0A  public HttpHandler getNext() %7B%0A    return next;%0A  %7D%0A%0A  @Override%0A  public MiddlewareHandler setNext(final HttpHandler next) %7B%0A    Handlers.handlerNotNull(next);%0A%0A    this.next = next;%0A%0A    return this;%0A  %7D%0A%0A  @Override%0A  public boolean isEnabled() %7B%0A    return config.isEnabled();%0A  %7D%0A%0A  @Override%0A  public void register() %7B%0A    ModuleRegistry.registerModule(ContentConfig.class.getName(), Config.getInstance().getJsonMapConfigNoCache(CONFIG_NAME), null);%0A  %7D%0A%0A  @Override%0A  public void handleRequest(final HttpServerExchange exchange) throws Exception %7B%0A    if (exchange.getRequestHeaders().contains(Headers.CONTENT_TYPE)) %7B%0A      exchange%0A        .getResponseHeaders()%0A        .put(Headers.CONTENT_TYPE, exchange.getRequestHeaders().get(Headers.CONTENT_TYPE).element());%0A    %7D else %7B%0A      exchange%0A        .getResponseHeaders()%0A        .put(Headers.CONTENT_TYPE, contentType);%0A    %7D%0A%0A    next.handleRequest(exchange);%0A  %7D%0A%7D%0A

add business logic to get content type header value from request or keep config type