I’d like to know how to avoid a 500 ise in a java application (tomcat) when I get a request bigger than 4K. What happens is that browser or apache (still didn’t understand who) truncate the request size to 4K and Tomcat raise an exception
An exception or error occurred in the container during the request
processing java.lang.IllegalArgumentException: Control character in
cookie value or attribute.
As far as I’ve red on the web the request is toasted so there is no way to handle the error in Java. Since I have no control on the request size (dozens of cookies from statistic tools with a lifetime longer than 6 months and set on “/” domain)
Is there a way to say apache “hey, if the request size is bigger than 3K redirect to this page”, and in this page I will erase all cookies. Do you have any better idea?
Regards,
Carlo
We found a workaround using a regexp we get the request size and then send to a custom page that erase cookies via js in order to avoid future 500 ise
Hope this helps,
regards.
Carlo