Revert "DEV: Disable ACE editor worker blobs"

This reverts commit d5463d2a4d.

With S3 assets, CORS prevents loading worker assets directly.
This commit is contained in:
David Taylor 2020-08-14 14:11:28 +01:00
parent 35d9d668c3
commit 3cf93e9a8f
No known key found for this signature in database
GPG Key ID: 46904C18B1D3F434
3 changed files with 5 additions and 3 deletions

View File

@ -74,8 +74,6 @@ export default Component.extend({
loadScript("/javascripts/ace/ace.js").then(() => {
window.ace.require(["ace/ace"], loadedAce => {
loadedAce.config.set("loadWorkerFromBlob", false);
if (!this.element || this.isDestroying || this.isDestroyed) {
return;
}

View File

@ -63,6 +63,8 @@ class ContentSecurityPolicy
def worker_src
[
"'self'",
"blob:",
*script_assets(worker: true)
]
end

View File

@ -33,9 +33,11 @@ describe ContentSecurityPolicy do
end
describe 'worker-src' do
it 'always has script srcs' do
it 'has expected values' do
worker_srcs = parse(policy)['worker-src']
expect(worker_srcs).to eq(%w[
'self'
blob:
http://test.localhost/assets/
http://test.localhost/brotli_asset/
http://test.localhost/javascripts/