Package io.netty.handler.codec.http
Class HttpServerExpectContinueHandler
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- io.netty.handler.codec.http.HttpServerExpectContinueHandler
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler
,io.netty.channel.ChannelInboundHandler
public class HttpServerExpectContinueHandler extends io.netty.channel.ChannelInboundHandlerAdapter
Sends a 100 CONTINUEHttpResponse
toHttpRequest
s which contain a 'expect: 100-continue' header. It should only be used for applications which do not install theHttpObjectAggregator
.By default it accepts all expectations.
Since
HttpServerExpectContinueHandler
expectsHttpRequest
s it should be added afterHttpServerCodec
but before any other handlers that might send aHttpResponse
.ChannelPipeline
p = ...; ... p.addLast("serverCodec", newHttpServerCodec
()); p.addLast("respondExpectContinue", newHttpServerExpectContinueHandler
()); ... p.addLast("handler", new HttpRequestHandler());
-
-
Constructor Summary
Constructors Constructor Description HttpServerExpectContinueHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected HttpResponse
acceptMessage(HttpRequest request)
Produces aHttpResponse
forHttpRequest
s which define an expectation.void
channelRead(io.netty.channel.ChannelHandlerContext ctx, Object msg)
protected HttpResponse
rejectResponse(HttpRequest request)
Returns the appropriate 4XXHttpResponse
for the givenHttpRequest
.-
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
-
-
-
-
Method Detail
-
acceptMessage
protected HttpResponse acceptMessage(HttpRequest request)
Produces aHttpResponse
forHttpRequest
s which define an expectation. Returnsnull
if the request should be rejected. SeerejectResponse(HttpRequest)
.
-
rejectResponse
protected HttpResponse rejectResponse(HttpRequest request)
Returns the appropriate 4XXHttpResponse
for the givenHttpRequest
.
-
-