Package org.littleshoot.proxy.impl
Class ProxyToServerConnection.HeadAwareHttpResponseDecoder
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.handler.codec.ByteToMessageDecoder
io.netty.handler.codec.http.HttpObjectDecoder
io.netty.handler.codec.http.HttpResponseDecoder
org.littleshoot.proxy.impl.ProxyToServerConnection.HeadAwareHttpResponseDecoder
- All Implemented Interfaces:
ChannelHandler,ChannelInboundHandler
- Enclosing class:
- ProxyToServerConnection
Responses to HEAD requests aren't supposed to have content, but Netty doesn't know that any given response is to a HEAD request, so it needs to be told that there's no content so that it doesn't hang waiting for it.
See the documentation for HttpResponseDecoder for information
about why HEAD requests need special handling.
Thanks to nataliakoval for pointing out that with connections being reused as they are, this needs to be sensitive to the current request.
-
Nested Class Summary
Nested classes/interfaces inherited from class io.netty.handler.codec.ByteToMessageDecoder
ByteToMessageDecoder.CumulatorNested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
ChannelHandler.Sharable -
Field Summary
Fields inherited from class io.netty.handler.codec.http.HttpObjectDecoder
DEFAULT_ALLOW_DUPLICATE_CONTENT_LENGTHS, DEFAULT_ALLOW_PARTIAL_CHUNKS, DEFAULT_CHUNKED_SUPPORTED, DEFAULT_INITIAL_BUFFER_SIZE, DEFAULT_MAX_CHUNK_SIZE, DEFAULT_MAX_HEADER_SIZE, DEFAULT_MAX_INITIAL_LINE_LENGTH, DEFAULT_VALIDATE_HEADERS, validateHeadersFields inherited from class io.netty.handler.codec.ByteToMessageDecoder
COMPOSITE_CUMULATOR, MERGE_CUMULATOR -
Constructor Summary
ConstructorsConstructorDescriptionHeadAwareHttpResponseDecoder(int maxInitialLineLength, int maxHeaderSize, int maxChunkSize) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanisContentAlwaysEmpty(HttpMessage httpMessage) Methods inherited from class io.netty.handler.codec.http.HttpResponseDecoder
createInvalidMessage, createMessage, isDecodingRequestMethods inherited from class io.netty.handler.codec.http.HttpObjectDecoder
decode, decodeLast, handlerRemoved0, handleTransferEncodingChunkedWithContentLength, isSwitchingToNonHttp1Protocol, reset, splitFirstWordInitialLine, splitHeaderName, splitSecondWordInitialLine, splitThirdWordInitialLine, userEventTriggeredMethods inherited from class io.netty.handler.codec.ByteToMessageDecoder
actualReadableBytes, callDecode, channelInactive, channelRead, channelReadComplete, discardSomeReadBytes, handlerRemoved, internalBuffer, isSingleDecode, setCumulator, setDiscardAfterReads, setSingleDecodeMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaughtMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
handlerAdded
-
Constructor Details
-
HeadAwareHttpResponseDecoder
public HeadAwareHttpResponseDecoder(int maxInitialLineLength, int maxHeaderSize, int maxChunkSize)
-
-
Method Details
-
isContentAlwaysEmpty
- Overrides:
isContentAlwaysEmptyin classHttpObjectDecoder
-