fixes bug 1089897 - propagate 400 errors from middleware
Merge pull request #2464 from peterbe/bug-1089897-propagate-400-errors-from-middleware

fixes bug 1089897 - propagate 400 errors from middleware