public static void sendMessageResponse(ResponseHandler handler, List<Cookie> cookies, int code, String message) {
        Response response = createResponse(code, cookies);
        ContentChannel contentChannel = handler.handleResponse(response);
        try {
            var mapper = Jackson.mapper();
            ObjectNode jsonNode = mapper.createObjectNode();
            jsonNode.set("message", TextNode.valueOf(message));
            byte[] jsonBytes = mapper.writerWithDefaultPrettyPrinter().writeValueAsBytes(jsonNode);
            contentChannel.write(ByteBuffer.wrap(jsonBytes), null);
        } catch (JsonProcessingException e) {
            throw new UncheckedIOException(e);
        }
        contentChannel.close(null);
    }
Helper methods for auth0/okta request filters.

@author valerijf
container-core/src/main/java/com/yahoo/jdisc/http/filter/util/FilterUtils.java