-
Notifications
You must be signed in to change notification settings - Fork 27
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
Enable validation of service workers #328
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, but let's wait for Ezz to give it a once over as well.
src/js/contentUtils.ts
Outdated
@@ -614,3 +615,15 @@ chrome.runtime.onMessage.addListener(request => { | |||
} | |||
} | |||
}); | |||
|
|||
function hasServiceWorkerHeader( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Can we name this hasVaryServiceWorkerHeader
for accuracy?
node.start, | ||
); | ||
if (before === DYNAMIC_STRING_MARKER) { | ||
ranges.push(node.start + 1, node.end - 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be helpful to comment that this the string excluding the left/right quotes, so that the empty string is what is validated.
Updates CV to validate service workers, which were previously ignored.
In order to achieve this, this PR includes the following: