public class CorsHandler
extends org.jboss.netty.channel.SimpleChannelUpstreamHandler
This handler can be configured using a CorsConfig
, 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 String |
ANY_ORIGIN |
Constructor and Description |
---|
CorsHandler(CorsConfig config)
Creates a new instance with the specified
CorsConfig . |
Modifier and Type | Method and Description |
---|---|
void |
messageReceived(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.MessageEvent e) |
static void |
setCorsResponseHeaders(org.jboss.netty.handler.codec.http.HttpRequest request,
org.jboss.netty.handler.codec.http.HttpResponse resp,
CorsConfig config) |
public static final String ANY_ORIGIN
public CorsHandler(CorsConfig config)
CorsConfig
.public void messageReceived(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.MessageEvent e) throws Exception
messageReceived
in class org.jboss.netty.channel.SimpleChannelUpstreamHandler
Exception
public static void setCorsResponseHeaders(org.jboss.netty.handler.codec.http.HttpRequest request, org.jboss.netty.handler.codec.http.HttpResponse resp, CorsConfig config)
Copyright © 2009–2017. All rights reserved.