public class HttpServerExpectContinueHandler
extends io.netty.channel.ChannelInboundHandlerAdapter
HttpResponse
to HttpRequest
s 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 HttpRequest
s it should be added after HttpServerCodec
but before any other handlers that might send a HttpResponse
.
ChannelPipeline
p = ...; ... p.addLast("serverCodec", newHttpServerCodec
()); p.addLast("respondExpectContinue", newHttpServerExpectContinueHandler
()); ... p.addLast("handler", new HttpRequestHandler());
Constructor and Description |
---|
HttpServerExpectContinueHandler() |
Modifier and Type | Method and Description |
---|---|
protected HttpResponse |
acceptMessage(HttpRequest request)
Produces a
HttpResponse for HttpRequest s which define an expectation. |
void |
channelRead(io.netty.channel.ChannelHandlerContext ctx,
Object msg) |
protected HttpResponse |
rejectResponse(HttpRequest request)
Returns the appropriate 4XX
HttpResponse for the given HttpRequest . |
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
protected HttpResponse acceptMessage(HttpRequest request)
HttpResponse
for HttpRequest
s 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
.Copyright © 2008–2023 The Netty Project. All rights reserved.