discourse/spec/integration
David Taylor 64be371749
DEV: Improve handling of invalid requests (#15841)
Our discourse_public_exceptions middleware is designed to catch bubbled exceptions from lower in the stack, and then use `ApplicationController.rescue_with_handler` to render an appropriate error response.

When the request itself is invalid, we had an escape-hatch to skip re-dispatching the request to ApplicationController. However, it was possible to work around this by 'layering' the errors. For example, if you made a request which resulted in a 404, but **also** had some other invalidity, the escape hatch would not be triggered.

This commit ensures that these kind of 'layered' errors are properly handled, without logging warnings. It also adds detection for invalid JSON bodies and badly-formed multipart requests.

The user-facing behavior is unchanged. This commit simply prevents warnings being logged for invalid requests.
2022-02-07 13:16:57 +00:00
..
api_keys_spec.rb DEV: Make add_api_parameter_route parameter deprecations errors (#15198) 2021-12-06 09:10:14 -06:00
auto_reject_reviewable_users_spec.rb FIX: do not send rejection emails to auto-deleted reviewable users (#12160) 2021-02-22 18:37:47 +05:30
category_tag_spec.rb
content_security_policy_spec.rb
email_style_spec.rb FIX: Pluralized translation overrides didn't work for en_US 2020-08-29 00:11:46 +02:00
flags_spec.rb
group_spec.rb
invalid_request_spec.rb DEV: Improve handling of invalid requests (#15841) 2022-02-07 13:16:57 +00:00
invite_only_registration_spec.rb DEV: Use `response.parsed_body` in specs (#9615) 2020-05-07 17:04:12 +02:00
message_bus_spec.rb
multisite_cookies_spec.rb SECURITY: Ensure _forum_session cookies cannot be reused between sites (#14950) 2021-11-15 15:50:12 +00:00
multisite_spec.rb DEV: Improve multisite testing (#14884) 2021-11-11 16:44:58 +00:00
rate_limiting_spec.rb FEATURE: Add global admin api key rate limiter (#12527) 2021-06-03 10:52:43 +01:00
same_ip_spammers_spec.rb
spam_rules_spec.rb
topic_auto_close_spec.rb FIX: Auto close topic from category settings based on topic created_at (#12082) 2021-02-17 07:51:39 +10:00
topic_thumbnail_spec.rb FIX: Make thumbnail tests start with a clean slate (#15216) 2021-12-07 13:07:45 -06:00
watched_words_spec.rb SECURITY: Escape watched word in error message (#14434) 2021-09-24 11:55:15 +03:00