discourse/spec/requests/admin
Alan Guo Xiang Tan 17e1bfe069
SECURITY: Preload data only when rendering application layout
This commit drops the `before_action :preload_json` callback in `ApplicationController` as it adds unnecessary complexity to `ApplicationController` as well as other controllers which has to skip this callback. The source of the complexity comes mainly from the following two conditionals in the `preload_json` method:

```
    # We don't preload JSON on xhr or JSON request
    return if request.xhr? || request.format.json?

    # if we are posting in makes no sense to preload
    return if request.method != "GET"
```

Basically, the conditionals solely exists for optimization purposes to ensure that we don't run the preloading code when the request is not a GET request and the response is not expected to be HTML. The key problem here is that the conditionals are trying to expect what the content type of the response will be and this has proven to be hard to get right. Instead, we can simplify this problem by running the preloading code in a more deterministic way which is to preload only when the `application` layout is being rendered and this is main change that this commit introduces.
2025-02-04 13:32:30 -03:00
..
config DEV: Unhide the set_locale_from_cookie setting to allow site translations (#30924) 2025-01-23 11:05:29 +08:00
admin_controller_spec.rb DEV: Allow fab! without block (#24314) 2023-11-09 16:47:59 -06:00
api_controller_spec.rb DEV: Add API scopes for post revisions (#26183) 2024-03-14 15:24:54 -06:00
backups_controller_spec.rb SECURITY: Preload data only when rendering application layout 2025-02-04 13:32:30 -03:00
badges_controller_spec.rb DEV: Allow fab! without block (#24314) 2023-11-09 16:47:59 -06:00
color_schemes_controller_spec.rb DEV: Introduce theme-owned color palettes (#30915) 2025-01-22 12:03:37 +03:00
dashboard_controller_spec.rb FEATURE: Allow admins to force refresh "What's new?" (#29911) 2024-11-27 09:40:55 +10:00
email_controller_spec.rb FIX: always search email logs including the cc: addresses 2025-01-27 21:57:24 -05:00
email_styles_controller_spec.rb DEV: Allow fab! without block (#24314) 2023-11-09 16:47:59 -06:00
email_templates_controller_spec.rb UX: Use DPageHeader on the Emails page (#30781) 2025-01-15 15:36:16 +11:00
embeddable_hosts_controller_spec.rb FEATURE: Extend embeddable hosts with Individual tags and author assignments (#26868) 2024-05-16 15:47:01 -04:00
embedding_controller_spec.rb UX: admins embedding page follows admin ux guideline (#30122) 2025-01-06 13:01:08 +11:00
emojis_controller_spec.rb DEV: Move admin config pages out of /customize/ sub-route (#30511) 2025-01-02 09:13:11 +10:00
form_templates_controller_spec.rb FIX: Form template limit validation (#28791) 2024-09-10 08:11:44 -07:00
groups_controller_spec.rb DEV: Allow fab! without block (#24314) 2023-11-09 16:47:59 -06:00
impersonate_controller_spec.rb DEV: Allow fab! without block (#24314) 2023-11-09 16:47:59 -06:00
permalinks_controller_spec.rb FIX: Permalink.create didn't work as expected anymore (#29895) 2024-11-22 21:11:26 +01:00
plugins_controller_spec.rb FIX: Don't allow access to plugin page if plugin is not visible (#26431) 2024-04-02 16:26:15 +03:00
reports_controller_spec.rb FIX: Reports did not respect user locale (#30524) 2025-01-02 13:05:53 +10:00
robots_txt_controller_spec.rb FIX: Show true content of robots.txt after restoring to default (#24980) 2023-12-20 23:00:37 +03:00
screened_emails_controller_spec.rb SECURITY: Moderators cannot see user emails. 2024-12-19 13:13:18 -03:00
screened_ip_addresses_controller_spec.rb DEV: Allow fab! without block (#24314) 2023-11-09 16:47:59 -06:00
screened_urls_controller_spec.rb DEV: Allow fab! without block (#24314) 2023-11-09 16:47:59 -06:00
search_logs_spec.rb DEV: Allow fab! without block (#24314) 2023-11-09 16:47:59 -06:00
site_settings_controller_spec.rb DEV: Unhide the set_locale_from_cookie setting to allow site translations (#30924) 2025-01-23 11:05:29 +08:00
site_texts_controller_spec.rb FEATURE: Allow showing site text search in selected locale (#28453) 2024-08-26 11:25:36 +10:00
staff_action_logs_controller_spec.rb FEATURE: Log tag group changes in staff action log (#28787) 2024-09-09 10:50:48 +08:00
themes_controller_spec.rb DEV: Block accidental serialization of entire AR models (#27668) 2024-07-01 17:08:48 -03:00
user_fields_controller_spec.rb DEV: Move admin config pages out of /customize/ sub-route (#30511) 2025-01-02 09:13:11 +10:00
users_controller_spec.rb FEATURE: show silence reason when viewing silenced users (#30635) 2025-01-08 16:04:19 +11:00
versions_controller_spec.rb FEATURE: call hub API to update Discourse discover enrollment. (#25634) 2024-02-23 11:42:28 +05:30
watched_words_controller_spec.rb SECURITY: limit the number of characters in watched word replacements. 2024-07-15 19:25:17 +08:00
web_hooks_controller_spec.rb FEATURE: Add Mechanism to redeliver all failed webhook events (#27609) 2024-07-08 15:43:16 -05:00