bezoerb / inline-critical

Inline critical path CSS and async load existing stylesheets
Other
115 stars 15 forks source link

Preserve integrity attribute #275

Closed chrisguttandin closed 3 years ago

chrisguttandin commented 3 years ago

This PR is making sure that an existing integrity attribute is copied over to a newly created preload tag.

It's a first step towards supporting CSP tags. I thought it makes sense to make incremental changes. @bezoerb please let me know if you think I should better make a PR with all changes instead or if anything needs to be changed here.

bezoerb commented 3 years ago

LGTM 👍 Incremental changes are perfect. They are much easier to review :)

Thanks @chrisguttandin

chrisguttandin commented 3 years ago

Hi @bezoerb, now that I began implementing the functionality to update a possible CSP meta tag, I noticed that there is another branch in the codebase which looks very similar to the one I modified.

https://github.com/bezoerb/inline-critical/blob/master/index.js#L131

Do I need to update that one as well?

bezoerb commented 3 years ago

Nope :) The link element here is created in line 108 so there shouldn't be any integrity attribute here. I think in this case the integrity attribute needs to be calculated