8000 fix: throw on invalid webRequest filters by trop[bot] · Pull Request #19580 · electron/electron · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: throw on invalid webRequest filters #19580

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

Conversation

trop[bot]
Copy link
Contributor
@trop trop bot commented Aug 1, 2019

Backport of #19570

See that PR for details.

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

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.
@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Aug 1, 2019
@trop trop bot added 5-0-x backport This is a backport PR labels Aug 1, 2019
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Aug 1, 2019
Copy link
Contributor
@zcbenz zcbenz left a comment

Choose a reason for hiding this comment

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

CI is failing:

net module ClientRequest API Should throw when invalid filters are passed to a request - Should throw when invalid filters are passed to a request
/Users/distiller/project/src/electron/spec/api-net-spec.js
moreReferenceError: expect is not defined

8000
@codebytere codebytere requested a review from zcbenz August 5, 2019 05:41
@zcbenz zcbenz merged commit fa2b3a3 into 5-0-x Aug 5, 2019
@release-clerk
Copy link
release-clerk bot commented Aug 5, 2019

Release Notes Persisted

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

@zcbenz zcbenz deleted the trop/5-0-x-bp-fix-throw-on-invalid-webrequest-filters-1564693430394 branch August 5, 2019 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5-0-x backport This is a backport PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0