Package io.netty5.handler.codec.http
Class HttpServerExpectContinueHandler
- java.lang.Object
-
- io.netty5.handler.codec.http.HttpServerExpectContinueHandler
-
- All Implemented Interfaces:
io.netty5.channel.ChannelHandler
public class HttpServerExpectContinueHandler extends Object implements io.netty5.channel.ChannelHandler
Sends a 100 CONTINUEHttpResponsetoHttpRequests 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
HttpServerExpectContinueHandlerexpectsHttpRequests it should be added afterHttpServerCodecbut before any other handlers that might send aHttpResponse.ChannelPipelinep = ...; ... 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 HttpResponseacceptMessage(io.netty5.buffer.api.BufferAllocator allocator, HttpRequest request)Produces aHttpResponseforHttpRequests which define an expectation.voidchannelRead(io.netty5.channel.ChannelHandlerContext ctx, Object msg)protected HttpResponserejectResponse(io.netty5.buffer.api.BufferAllocator allocator, HttpRequest request)Returns the appropriate 4XXHttpResponsefor the givenHttpRequest.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.netty5.channel.ChannelHandler
bind, channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, close, connect, deregister, disconnect, exceptionCaught, flush, handlerAdded, handlerRemoved, read, register, userEventTriggered, write
-
-
-
-
Method Detail
-
acceptMessage
protected HttpResponse acceptMessage(io.netty5.buffer.api.BufferAllocator allocator, HttpRequest request)
Produces aHttpResponseforHttpRequests which define an expectation. Returnsnullif the request should be rejected. SeerejectResponse(BufferAllocator, HttpRequest).
-
rejectResponse
protected HttpResponse rejectResponse(io.netty5.buffer.api.BufferAllocator allocator, HttpRequest request)
Returns the appropriate 4XXHttpResponsefor the givenHttpRequest.
-
-