code: protected void handleRenderedResponse(HttpServerExchange exchange, Response response) {
          exchange.setStatusCode(response.getStatusCode());
          
          Server.headers()
              .entrySet()
              .stream()
              .filter(entry -> StringUtils.isNotBlank(entry.getValue()))
              .forEach(entry -> exchange.getResponseHeaders().add(entry.getKey().toHttpString(), entry.getValue()));
          
          exchange.getResponseHeaders().put(Header.CONTENT_TYPE.toHttpString(), response.getContentType() + "; charset=" + response.getCharset());
          response.getHeaders().forEach((key, value) -> exchange.getResponseHeaders().add(key, value));
          exchange.getResponseSender().send(response.getBody());
      }
docs: Handles a rendered response to the client by sending the rendered body from the response object
  
  @param exchange The Undertow HttpServerExchange
  @param response The response object