Package org.infinispan.rest.cors
Class CorsHandler
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- io.netty.channel.ChannelDuplexHandler
-
- org.infinispan.rest.cors.CorsHandler
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler
,io.netty.channel.ChannelInboundHandler
,io.netty.channel.ChannelOutboundHandler
public class CorsHandler extends io.netty.channel.ChannelDuplexHandler
Handles Cross Origin Resource Sharing (CORS) requests.This handler can be configured using one or more
CorsConfig
, please refer to this class for details about the configuration options available. //TODO: remove when multi-config CorsHandler is supported by Netty (https://github.com/netty/netty/issues/7785)
-
-
Constructor Summary
Constructors Constructor Description CorsHandler(List<io.netty.handler.codec.http.cors.CorsConfig> configList, boolean isShortCircuit)
Creates a new instance with the specified config list.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
channelRead(io.netty.channel.ChannelHandlerContext ctx, Object msg)
void
write(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise)
-
Methods inherited from class io.netty.channel.ChannelDuplexHandler
bind, close, connect, deregister, disconnect, flush, read
-
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
-
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
-
-
-
-
Constructor Detail
-
CorsHandler
public CorsHandler(List<io.netty.handler.codec.http.cors.CorsConfig> configList, boolean isShortCircuit)
Creates a new instance with the specified config list. If more than one config matches a certain origin, the first in the List will be used.- Parameters:
configList
- List ofCorsConfig
isShortCircuit
- Same asCorsConfig.shortCircuit
but applicable to all supplied configs.
-
-
Method Detail
-
channelRead
public void channelRead(io.netty.channel.ChannelHandlerContext ctx, Object msg)
- Specified by:
channelRead
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
channelRead
in classio.netty.channel.ChannelInboundHandlerAdapter
-
write
public void write(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise)
- Specified by:
write
in interfaceio.netty.channel.ChannelOutboundHandler
- Overrides:
write
in classio.netty.channel.ChannelDuplexHandler
-
-