The problem is ESP does return an error, but it doesn't want to fully read the huge requests so the socket closes while the client is still writing.. which throws an exception and probably won't allow the response to be read.  It happens at a pretty low level and I think it was originally intended to prevent some sort of denial of service attack with huge requests.  I think the only fix would be to go ahead and fully read the request no matter how large.