You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and it will return bad request tips(http code:500) to the user, it will make the user confused.
how can i set specific tips response my user,such as:your request is too big?
I find these code in class org.littleshoot.proxy.impl.DefaultHttpProxyServer:
in class io.netty.handler.codec.http.HttpObjectAggregator
if (content.readableBytes() > maxContentLength - chunk.content().readableBytes()) {
// release current message to prevent leaks
currentMessage.release();
currentMessage = null;
throw new TooLongFrameException(
"HTTP content length exceeded " + maxContentLength +
" bytes.");
}
in class org.littleshoot.proxy.impl.ClientToProxyConnection
@Override
protected void exceptionCaught(Throwable cause) {
try {
if (cause instanceof IOException) {
// IOExceptions are expected errors, for example when a browser is killed and aborts a connection.
// rather than flood the logs with stack traces for these expected exceptions, we log the message at the
// INFO level and the stack trace at the DEBUG level.
LOG.info("An IOException occurred on ClientToProxyConnection: " + cause.getMessage());
LOG.debug("An IOException occurred on ClientToProxyConnection", cause);
} else if (cause instanceof RejectedExecutionException) {
LOG.info("An executor rejected a read or write operation on the ClientToProxyConnection (this is normal if the proxy is shutting down). Message: " + cause.getMessage());
LOG.debug("A RejectedExecutionException occurred on ClientToProxyConnection", cause);
} else {
LOG.error("Caught an exception on ClientToProxyConnection", cause);
}
} finally {
// always disconnect the client when an exception occurs on the channel
disconnect();
}
}
The text was updated successfully, but these errors were encountered:
we use littleproxy as http gateway in our website and set MaximumRequestBufferSize 4 * 1024 * 1024 bytes,it works well.
my server will log exception if a request bigger than 4 * 1024 * 1024:
and it will return bad request tips(http code:500) to the user, it will make the user confused.
how can i set specific tips response my user,such as:your request is too big?
I find these code in class org.littleshoot.proxy.impl.DefaultHttpProxyServer:
in class io.netty.handler.codec.http.HttpObjectAggregator
in class org.littleshoot.proxy.impl.ClientToProxyConnection
The text was updated successfully, but these errors were encountered: