Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: throw on invalid webRequest filters #19570

Merged
merged 1 commit into from Aug 1, 2019

Conversation

@codebytere
Copy link
Member

commented Aug 1, 2019

Backport of #19337.

See that PR for more details.

Notes: Fixed error throwing on invalid webRequest url pattern filtering in onBeforeRequest.

fix: throw on invalid webRequest filters (#19337)
Closes #11371.

Previously, we didn't consider the return value of the webRequest URLPattern mate converter, which meant that when the pattern wasn't correctly parsed owing to invalid filter specification users would not be made aware of that fact and would just think that the filtering itself had failed. This corrects that error by moving the business logic of url pattern parsing out of the converter and into the function itself so that granular and specific errors can be thrown.

There's also no real reason that i'm aware of not to allow wider breadth of filters by letting users use a wildcard for effective TLD, so I also overrode that (default for the 1-arg Parse is not to allow that).

Finally, I added some examples of url filter types for users to reference.

@trop trop bot referenced this pull request Aug 1, 2019

Merged

fix: throw on invalid webRequest filters #19337

5 of 5 tasks complete

@codebytere codebytere requested a review from electron/wg-releases Aug 1, 2019

@codebytere codebytere added 6-0-x backport and removed new-pr 🌱 labels Aug 1, 2019

@MarshallOfSound MarshallOfSound merged commit 75fecf4 into 6-0-x Aug 1, 2019

14 of 15 checks passed

Artifact Comparison Changes Detected
Details
Backportable? - 5-0-x Clean Backport
Details
Semantic Pull Request ready to be squashed
Details
Valid Backport Valid Backport
Details
WIP Ready for review
Details
appveyor: win-ia32-testing AppVeyor build succeeded
Details
appveyor: win-ia32-testing-pr AppVeyor build succeeded
Details
appveyor: win-x64-testing AppVeyor build succeeded
Details
appveyor: win-x64-testing-pr AppVeyor build succeeded
Details
build-linux Workflow: build-linux
Details
build-mac Workflow: build-mac
Details
electron-arm-testing Build #20190801.29 succeeded
Details
electron-arm64-testing Build #20190801.22 succeeded
Details
lint Workflow: lint
Details
release-notes Release notes found
@release-clerk

This comment has been minimized.

Copy link

commented Aug 1, 2019

Release Notes Persisted

Fixed error throwing on invalid webRequest url pattern filtering in onBeforeRequest.

@MarshallOfSound MarshallOfSound deleted the throw-webreq-6 branch Aug 1, 2019

@trop

This comment has been minimized.

Copy link
Contributor

commented Aug 1, 2019

I have automatically backported this PR to "5-0-x", please check out #19580

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.