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
private class ProxyToServerConnection.HeadAwareHttpResponseDecoder extends HttpResponseDecoder
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
HttpResponseDecoderfor 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.Cumulator
-
Nested 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, validateHeaders
-
Fields inherited from class io.netty.handler.codec.ByteToMessageDecoder
COMPOSITE_CUMULATOR, MERGE_CUMULATOR
-
-
Constructor Summary
Constructors Constructor Description HeadAwareHttpResponseDecoder(int maxInitialLineLength, int maxHeaderSize, int maxChunkSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanisContentAlwaysEmpty(HttpMessage httpMessage)-
Methods inherited from class io.netty.handler.codec.http.HttpResponseDecoder
createInvalidMessage, createMessage, isDecodingRequest
-
Methods inherited from class io.netty.handler.codec.http.HttpObjectDecoder
decode, decodeLast, handlerRemoved0, handleTransferEncodingChunkedWithContentLength, isSwitchingToNonHttp1Protocol, reset, splitFirstWordInitialLine, splitHeaderName, splitSecondWordInitialLine, splitThirdWordInitialLine, userEventTriggered
-
Methods inherited from class io.netty.handler.codec.ByteToMessageDecoder
actualReadableBytes, callDecode, channelInactive, channelRead, channelReadComplete, discardSomeReadBytes, handlerRemoved, internalBuffer, isSingleDecode, setCumulator, setDiscardAfterReads, setSingleDecode
-
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught
-
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, isSharable
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.netty.channel.ChannelHandler
handlerAdded
-
-
-
-
Method Detail
-
isContentAlwaysEmpty
protected boolean isContentAlwaysEmpty(HttpMessage httpMessage)
- Overrides:
isContentAlwaysEmptyin classHttpObjectDecoder
-
-