public void write(final ChannelHandlerContext ctx, final Object msg, final ChannelPromise promise)
throws Exception {
if (msg instanceof Frame) {
final Frame frame = (Frame) msg;
final ByteBuf content = Transports.wrapWithLN(frame.content());
frame.release();
final FullHttpResponse response = new DefaultFullHttpResponse(request.getProtocolVersion(), OK, content);
response.headers().set(CONTENT_TYPE, CONTENT_TYPE_JAVASCRIPT);
response.headers().set(CONTENT_LENGTH, content.readableBytes());
response.headers().set(CONNECTION, CLOSE);
Transports.setDefaultHeaders(response, config, request);