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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] ignoredUrls doesn't work on SRI anymore [0.5] #1990

Closed
molant opened this Issue Mar 1, 2019 · 4 comments

Comments

Projects
None yet
3 participants
@molant
Copy link
Member

commented Mar 1, 2019

馃悰 Bug report

Description

Since b230947 it seems like ignoredUrls no longer works with sri.
The reason is that the resource is now the HTML instead of the asset, which is where the error actually is.

I don't think ignoredUrls is accessible to the hints via context so the only solution I see is to add a new option to the hint to ignore specifc domains.

This is currently blocking us from deploying a new version of the site 馃槥

@antross @sarvaje any other ideas?

@molant molant added the type:bug label Mar 1, 2019

@sarvaje

This comment has been minimized.

Copy link
Member

commented Mar 1, 2019

I think the problem is the traverse events. In those events, the resource is the url we are analyzing and not the url of the element (src in scripts, href in css).

Maybe an option is adding the ignoredUrls to the context?

@molant

This comment has been minimized.

Copy link
Member Author

commented Mar 1, 2019

Maybe an option is adding the ignoredUrls to the context?

We will still have to add code to the rule to handle the issue.
Should we provide the whole ignoredUrls or filtered based on the hint? I.e.: if the ignoredUrl has a value of * we pass it to all the hints. If not, we just pass it to the ones indicated.

@sarvaje

This comment has been minimized.

Copy link
Member

commented Mar 1, 2019

We will still have to add code to the rule to handle the issue.

Yep. The developer of the hint should take care of this in each rule if necessary.

I like the filtered by hint idea.

@antross

This comment has been minimized.

Copy link
Member

commented Mar 4, 2019

Agreed. Since HintContext already has the hint ID, how about making an ignoreUrl helper on the context that takes the URL we want to know if we should ignore (and then the hint can take care of how to ignore it)?

public ignoreUrl(url: string): boolean

@sarvaje sarvaje self-assigned this Mar 6, 2019

@sarvaje sarvaje added this to the 1903-1 milestone Mar 6, 2019

sarvaje added a commit to sarvaje/hint that referenced this issue Mar 6, 2019

@sarvaje sarvaje changed the title [Bug] ignoredUrls doesn't work on SRI anymore [Bug] ignoredUrls doesn't work on SRI anymore [0.5] Mar 6, 2019

sarvaje added a commit to sarvaje/hint that referenced this issue Mar 6, 2019

@molant molant closed this in 9c279b9 Mar 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.