public class HttpServerExpectContinueHandler extends ChannelInboundHandlerAdapter
HttpResponse to HttpRequests which contain a 'expect: 100-continue' header. It
should only be used for applications which do not install the HttpObjectAggregator.
By default it accepts all expectations.
Since HttpServerExpectContinueHandler expects HttpRequests it should be added after HttpServerCodec but before any other handlers that might send a HttpResponse.
ChannelPipelinep = ...; ... p.addLast("serverCodec", newHttpServerCodec()); p.addLast("respondExpectContinue", newHttpServerExpectContinueHandler()); ... p.addLast("handler", new HttpRequestHandler());
ChannelHandler.Sharable| Constructor and Description |
|---|
HttpServerExpectContinueHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected HttpResponse |
acceptMessage(HttpRequest request)
Produces a
HttpResponse for HttpRequests which define an expectation. |
void |
channelRead(ChannelHandlerContext ctx,
Object msg)
Calls
ChannelHandlerContext.fireChannelRead(Object) to forward
to the next ChannelInboundHandler in the ChannelPipeline. |
protected HttpResponse |
rejectResponse(HttpRequest request)
Returns the appropriate 4XX
HttpResponse for the given HttpRequest. |
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredensureNotSharable, handlerAdded, handlerRemoved, isSharableclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithandlerAdded, handlerRemovedprotected HttpResponse acceptMessage(HttpRequest request)
HttpResponse for HttpRequests which define an expectation. Returns null if the
request should be rejected. See rejectResponse(HttpRequest).protected HttpResponse rejectResponse(HttpRequest request)
HttpResponse for the given HttpRequest.public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception
ChannelInboundHandlerAdapterChannelHandlerContext.fireChannelRead(Object) to forward
to the next ChannelInboundHandler in the ChannelPipeline.
Sub-classes may override this method to change behavior.channelRead in interface ChannelInboundHandlerchannelRead in class ChannelInboundHandlerAdapterExceptionCopyright © 2008–2017 The Netty Project. All rights reserved.