https://issues.jboss.org/browse/RAILO-2959

This fix (or something like it) probably needs to be merged into the other 4.x branches as well.