Giter Club home page Giter Club logo

Comments (11)

MumblingFumbler avatar MumblingFumbler commented on June 25, 2024 1

Yeesh!!! The hash generated is browser dependent. If I generate on Firefox and display on Chrome, I get an error.
and vice-versa. If I display on the same version as generated, it works. Bad news!

from srihash.org.

kota-yata avatar kota-yata commented on June 25, 2024

Your hash output does not match the URL.
The actual hash384 output for https://fonts.googleapis.com/icon?family=Material+Icons is sha384-r4ArzcycohCKpd5lRaMM1i3qmqqCo7BsUvmnhusfNZ5LXOGHyZR8j+TURxWIGUO/

from srihash.org.

MumblingFumbler avatar MumblingFumbler commented on June 25, 2024

I used this website: https://www.srihash.org/ Is this the wrong site?
I used this URL: https://fonts.googleapis.com/icon?family=Material+Icons
I selected 'SHA-384' from the pulldown to the right of the URL
I clicked on 'Hash!'
I copied the following output:
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" integrity="sha384-zfmep/8lfJ4cVW8HCW1SWfWf0ckqJhJDO5kJ2udXM/imt7aX9neyBDFFyuL1TT50" crossorigin="anonymous">
I got the following error:
Browser(s) (Chrome and Firefox) error
The hash in the 'integrity' attribute doesn't match the received payload.
What could I do differently on the site to get the hash that you came up with?
Even when I paste in your hash from above, I get the same error

from srihash.org.

kota-yata avatar kota-yata commented on June 25, 2024

I cannot reproduce your bug on my computer. Could you record your screen during the operation above please?

from srihash.org.

MumblingFumbler avatar MumblingFumbler commented on June 25, 2024

SRI Hash Generator
Browser Version:
Firefox Version

Hope this helps

from srihash.org.

MumblingFumbler avatar MumblingFumbler commented on June 25, 2024

Here is a description of the problem from someone else:
https://stackoverflow.com/questions/44043585/google-chrome-sri-hash
sounds like the hash is browser dependent. If I acquire the has on Firefox,
and display using Chrome, it doesn't work? I'll test...
Having to use a different hash depending on the browser would be unfortunate.

from srihash.org.

kota-yata avatar kota-yata commented on June 25, 2024

Well...Google Fonts seems to have some problems...
I think we could do nothing with this problem, since the hash value should change if the content of the file has changed.

from srihash.org.

kota-yata avatar kota-yata commented on June 25, 2024

One possible way is generating multiple hash value for different user agent as this comment. I will try this solution.

from srihash.org.

mozfreddyb avatar mozfreddyb commented on June 25, 2024

To summarize: Google Fonts is serving a different file depending on the browser being used. Naturally, srihash.org can only detect the resource that the current browser is seeing and can not ensure the server will always serve the same response.

I could imagine turning this issue into a work item detect about popular CDNs that serve browser-dependent payloads on srihash.org and emit a tiny warning/info box when people use it for e.g., google fonts. Would anyone of the folks in there be interested in figuring out and implementing such a feature?

from srihash.org.

kota-yata avatar kota-yata commented on June 25, 2024

I'm working on it.

from srihash.org.

mozfreddyb avatar mozfreddyb commented on June 25, 2024

#518 :)

from srihash.org.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.