public static void allowThenClose(ChannelHandlerContext ctx) {
        // Just flag this channel to be closed after response complete.
        ctx.channel()
                .attr(ConnectionCloseChannelAttributes.CLOSE_AFTER_RESPONSE)
                .set(ctx.newPromise());

        // And allow this request through without rejecting.
    }
Marks the given channel for being closed after the next response.

@param ctx the channel handler processing the request
zuul-core/src/main/java/com/netflix/netty/common/throttle/RejectionUtils.java