Package org.mockserver.netty.proxy.relay
Class LoopbackHttp1ResponseErrorHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
org.mockserver.netty.proxy.relay.LoopbackHttp1ResponseErrorHandler
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler
public class LoopbackHttp1ResponseErrorHandler
extends io.netty.channel.ChannelInboundHandlerAdapter
Answers the proxy client with a
502 when the CONNECT/SOCKS relay's HTTP/1.1 loopback fails to decode a
response (a corrupt compressed body, one larger than maxRequestBodySize, or one the codec marks as failed)
before its head has been relayed.
After the head the client is left with an incomplete response: DownstreamProxyRelayHandler closes both
connections and no terminating chunk is written. Either way the exception carries on to it, which logs and closes,
and anything decoded after it is dropped.
Sits between the loopback's aggregator and DownstreamProxyRelayHandler; one per loopback.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Constructor Summary
ConstructorsConstructorDescriptionLoopbackHttp1ResponseErrorHandler(io.netty.channel.Channel proxyClientChannel) -
Method Summary
Modifier and TypeMethodDescriptionvoidchannelRead(io.netty.channel.ChannelHandlerContext ctx, Object msg) voidexceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause) Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggeredMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, 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, handlerRemoved
-
Constructor Details
-
LoopbackHttp1ResponseErrorHandler
public LoopbackHttp1ResponseErrorHandler(io.netty.channel.Channel proxyClientChannel)
-
-
Method Details
-
channelRead
- Specified by:
channelReadin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelReadin classio.netty.channel.ChannelInboundHandlerAdapter
-
exceptionCaught
- Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelHandler- Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
exceptionCaughtin classio.netty.channel.ChannelInboundHandlerAdapter
-