mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-02 09:31:40 +08:00
In some error paths, headers that were set earlier can get overwritten (e.g. `Cross-Origin-Opener-Policy`) by middleware such as ActionDispatch::ShowExceptions. This PR sets the `Cross-Origin-Opener-Policy` header to the value of the SiteSetting `cross_origin_opener_policy_header` if it's missing and if the response is for HTML. In future, this DefaultHeaders middleware can be used to set other default headers that relate to security or other purposes. ### Testing <img width="631" alt="test" src="https://github.com/user-attachments/assets/05106a40-2bc7-435d-91a2-4dd2a098f349" /> |
||
|---|---|---|
| .. | ||
| coding_style_spec.rb | ||
| common_mark_spec.rb | ||
| having_multiple_tagged_loggers_spec.rb | ||
| i18n_spec.rb | ||
| js_constants_spec.rb | ||
| middleware_order_spec.rb | ||
| oj_spec.rb | ||
| onceoff_integrity_spec.rb | ||
| site_setting_spec.rb | ||