DEV: Add validation for allowed iframes setting (#28178)

- Adds a validator for the allowed iframes site setting
- Adds a migration to update any values that don't pass the validator

Follow up to: 188cb58daa833839c54c266ce22db150a3f3a210
This commit is contained in:
Blake Erickson
2024-08-01 06:51:02 -06:00
committed by GitHub
parent 492a45da37
commit 6ee6b1f1d1
5 changed files with 63 additions and 1 deletions

View File

@ -713,7 +713,7 @@ RSpec.describe Oneboxer do
body: allowlisted_oembed.to_json,
)
SiteSetting.allowed_iframes = "discourse.org|https://ifram.es"
SiteSetting.allowed_iframes = "https://discourse.org/|https://ifram.es/"
expect(Oneboxer.onebox("https://blocklist.ed/iframes", invalidate_oneboxes: true)).to be_empty
expect(Oneboxer.onebox("https://allowlist.ed/iframes", invalidate_oneboxes: true)).to match(