Merge pull request #17255 from printercu/cors_exception_wrapper

ActionController::InvalidCrossOriginRequest fails with 422 instead of 500