Skip to content

fix: allow accessing file:// when web security is disabled#28489

Merged
zcbenz merged 4 commits intomasterfrom
fix-request-file-protocol
Apr 7, 2021
Merged

fix: allow accessing file:// when web security is disabled#28489
zcbenz merged 4 commits intomasterfrom
fix-request-file-protocol

Conversation

@zcbenz
Copy link
Contributor

@zcbenz zcbenz commented Apr 2, 2021

Description of Change

Subresource file:// requests should be explicitly allowed when web security is disabled, closes #23757.

This PR also rewrites webview web security tests, since they were passing even though file:// requests were actually failing.

Checklist

Release Notes

Notes: Fix failing to request file:// resources when web security is disabled.

@zcbenz zcbenz added semver/patch backwards-compatible bug fixes target/11-x-y labels Apr 2, 2021
@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Apr 2, 2021

describe('disablewebsecurity attribute', () => {
it('does not disable web security when not set', async () => {
const jqueryPath = path.join(__dirname, '/static/jquery-2.0.3.min.js');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we delete jquery-2.0.3.min.js from our tests now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are still a few places using it, but I think we should be able to rework those places to remove this file.

@zcbenz zcbenz force-pushed the fix-request-file-protocol branch from 39c4c2b to 247c4c8 Compare April 3, 2021 00:27
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Apr 3, 2021
@zcbenz zcbenz merged commit e454bde into master Apr 7, 2021
@release-clerk
Copy link

release-clerk bot commented Apr 7, 2021

Release Notes Persisted

Fix failing to request file:// resources when web security is disabled.

@zcbenz zcbenz deleted the fix-request-file-protocol branch April 7, 2021 01:46
@trop
Copy link
Contributor

trop bot commented Apr 7, 2021

I was unable to backport this PR to "12-x-y" cleanly;
you will need to perform this backport manually.

@trop trop bot removed the target/12-x-y label Apr 7, 2021
@trop
Copy link
Contributor

trop bot commented Apr 7, 2021

I was unable to backport this PR to "11-x-y" cleanly;
you will need to perform this backport manually.

@trop
Copy link
Contributor

trop bot commented Apr 7, 2021

I have automatically backported this PR to "13-x-y", please check out #28557

@trop
Copy link
Contributor

trop bot commented Apr 7, 2021

@zcbenz has manually backported this PR to "12-x-y", please check out #28560

@trop
Copy link
Contributor

trop bot commented Apr 9, 2021

@zcbenz has manually backported this PR to "11-x-y", please check out #28589

@jtbandes
Copy link

jtbandes commented Apr 9, 2021

It looks like this PR also fixed #28572! 🙌 Was that an intentional side-effect of this change? Would it make sense to add more tests to ensure the SharedWorker behavior specifically does not regress?

Comment on lines +1301 to +1302
// Workers are not allowed to request file:// URLs, there is no particular
// reason for it, and we could consider supporting it in future.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment makes me wonder if the fix for SharedWorkers was unintentional 😛

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9.0.0 does not display local images

4 participants