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:
parent
35d9d668c3
commit
3cf93e9a8f
|
@ -74,8 +74,6 @@ export default Component.extend({
|
||||||
|
|
||||||
loadScript("/javascripts/ace/ace.js").then(() => {
|
loadScript("/javascripts/ace/ace.js").then(() => {
|
||||||
window.ace.require(["ace/ace"], loadedAce => {
|
window.ace.require(["ace/ace"], loadedAce => {
|
||||||
loadedAce.config.set("loadWorkerFromBlob", false);
|
|
||||||
|
|
||||||
if (!this.element || this.isDestroying || this.isDestroyed) {
|
if (!this.element || this.isDestroying || this.isDestroyed) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,6 +63,8 @@ class ContentSecurityPolicy
|
||||||
|
|
||||||
def worker_src
|
def worker_src
|
||||||
[
|
[
|
||||||
|
"'self'",
|
||||||
|
"blob:",
|
||||||
*script_assets(worker: true)
|
*script_assets(worker: true)
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
|
@ -33,9 +33,11 @@ describe ContentSecurityPolicy do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'worker-src' do
|
describe 'worker-src' do
|
||||||
it 'always has script srcs' do
|
it 'has expected values' do
|
||||||
worker_srcs = parse(policy)['worker-src']
|
worker_srcs = parse(policy)['worker-src']
|
||||||
expect(worker_srcs).to eq(%w[
|
expect(worker_srcs).to eq(%w[
|
||||||
|
'self'
|
||||||
|
blob:
|
||||||
http://test.localhost/assets/
|
http://test.localhost/assets/
|
||||||
http://test.localhost/brotli_asset/
|
http://test.localhost/brotli_asset/
|
||||||
http://test.localhost/javascripts/
|
http://test.localhost/javascripts/
|
||||||
|
|
Loading…
Reference in New Issue