code: protected void handleRedirectResponse(HttpServerExchange exchange, Response response) {
          exchange.setStatusCode(StatusCodes.FOUND);
          
          Server.headers()
              .entrySet()
              .stream()
              .filter(entry -> StringUtils.isNotBlank(entry.getValue()))
              .forEach(entry -> exchange.getResponseHeaders().add(entry.getKey().toHttpString(), entry.getValue()));
  
          exchange.getResponseHeaders().put(Header.LOCATION.toHttpString(), response.getRedirectTo());
          response.getHeaders().forEach((key, value) -> exchange.getResponseHeaders().add(key, value));
          exchange.endExchange();
      }
docs: Handles a redirect response to the client by sending a 403 status code to the client
  
  @param exchange The Undertow HttpServerExchange
  @param response The response object