public class Netty4CorsHandler
extends io.netty.channel.ChannelDuplexHandler
This handler can be configured using a Netty4CorsConfig, please
refer to this class for details about the configuration options available.
This code was borrowed from Netty 4 and refactored to work for Elasticsearch's Netty 3 setup.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ANY_ORIGIN |
| Constructor and Description |
|---|
Netty4CorsHandler(Netty4CorsConfig config)
Creates a new instance with the specified
Netty4CorsConfig. |
| Modifier and Type | Method and Description |
|---|---|
void |
channelRead(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Object msg) |
static void |
setCorsResponseHeaders(io.netty.handler.codec.http.HttpRequest request,
io.netty.handler.codec.http.HttpResponse resp,
Netty4CorsConfig config) |
bind, close, connect, deregister, disconnect, flush, read, writechannelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredhandlerAdded, handlerRemoved, isSharablepublic static final java.lang.String ANY_ORIGIN
public Netty4CorsHandler(Netty4CorsConfig config)
Netty4CorsConfig.public void channelRead(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Object msg)
throws java.lang.Exception
channelRead in interface io.netty.channel.ChannelInboundHandlerchannelRead in class io.netty.channel.ChannelInboundHandlerAdapterjava.lang.Exceptionpublic static void setCorsResponseHeaders(io.netty.handler.codec.http.HttpRequest request,
io.netty.handler.codec.http.HttpResponse resp,
Netty4CorsConfig config)