Top Description Constructors Methods
io.netty5.handler.codec.http

public Class HttpServerExpectContinueHandler

extends Object
implements ChannelHandler
Class Inheritance
All Implemented Interfaces
io.netty5.channel.ChannelHandler
Imports
io.netty5.buffer.BufferAllocator, io.netty5.channel.ChannelFutureListeners, .ChannelHandler, .ChannelHandlerContext, io.netty5.util.Resource

Sends a 100 CONTINUE 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.

 io.netty5.channel.ChannelPipeline p = ...;
 ...
 p.addLast("serverCodec", new HttpServerCodec());
 p.addLast("respondExpectContinue", new HttpServerExpectContinueHandler());
 ...
 p.addLast("handler", new HttpRequestHandler());
 

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected HttpResponse
acceptMessage(BufferAllocator allocator, HttpRequest request)

Produces a HttpResponse for HttpRequests which define an expectation.

public void
channelRead(ChannelHandlerContext ctx, Object msg)

Overrides default io.netty5.channel.ChannelHandler.channelRead.

Invoked when the current Channel has read a message from the peer.
private static DefaultFullHttpResponse
protected HttpResponse
rejectResponse(BufferAllocator allocator, HttpRequest request)

Returns the appropriate 4XX HttpResponse for the given HttpRequest.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

HttpServerExpectContinueHandlerback to summary
public HttpServerExpectContinueHandler()

Method Detail

acceptMessageback to summary
protected HttpResponse acceptMessage(BufferAllocator allocator, HttpRequest request)

Produces a HttpResponse for HttpRequests which define an expectation. Returns null if the request should be rejected. See rejectResponse(BufferAllocator, HttpRequest).

channelReadback to summary
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception

Overrides default io.netty5.channel.ChannelHandler.channelRead.

Doc from io.netty5.channel.ChannelHandler.channelRead.

Invoked when the current Channel has read a message from the peer.

Annotations
@Override
newEmptyResponseback to summary
private static DefaultFullHttpResponse newEmptyResponse(BufferAllocator allocator, HttpResponseStatus status)
rejectResponseback to summary
protected HttpResponse rejectResponse(BufferAllocator allocator, HttpRequest request)

Returns the appropriate 4XX HttpResponse for the given HttpRequest.