mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 20:21:25 +08:00
FIX: Improve handling of 'PublicExceptions' when bootstrap_error_pages enabled (#26700)
- Run the CSP-nonce-related middlewares on the generated response - Fix the readonly mode checking to avoid empty strings being passed (the `check_readonly_mode` before_action will not execute in the case of these re-dispatched exceptions) - Move the BlockRequestsMiddleware cookie-setting to the middleware, so that it is included even for unusual HTML responses like these exceptions
This commit is contained in:
@ -641,8 +641,8 @@ class ApplicationController < ActionController::Base
|
||||
store_preloaded("customHTML", custom_html_json)
|
||||
store_preloaded("banner", banner_json)
|
||||
store_preloaded("customEmoji", custom_emoji)
|
||||
store_preloaded("isReadOnly", @readonly_mode.to_s)
|
||||
store_preloaded("isStaffWritesOnly", @staff_writes_only_mode.to_s)
|
||||
store_preloaded("isReadOnly", get_or_check_readonly_mode.to_json)
|
||||
store_preloaded("isStaffWritesOnly", get_or_check_staff_writes_only_mode.to_json)
|
||||
store_preloaded("activatedThemes", activated_themes_json)
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user