You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Whitelisting external JavaScript with hashs, the spec mentions that if there is integrity metadata on an element, it must match the hash-sources. However, SRI and CSP subtly use different resource bodies to compute digests. SRI computes digests on the raw resources (i.e. applying the digest algorithm to the representation data) while CSP applies digests to an encoded string (as discussed in #109, in practice UAs apply it to the UTF-8 encoding while the specs actually apply it to the UTF-16 encoding).
I'm not sure of the best solution to this since, inherently the integrity metadata is potentially different from the hash source list. We could special case UTF-8/16 encoded resources, but that seems odd. Offhand, it seems like this section isn't possible with how the digests are currently computed.