fission-codes / dashboard

The account dashboard for the Fission platform
https://dashboard.fission.codes
GNU Affero General Public License v3.0
8 stars 0 forks source link

Unstyled account recovery page due to incorrect mime type #45

Open justindotpub opened 2 years ago

justindotpub commented 2 years ago

Summary

Problem

During account recovery via email (without an account recovery kit), after clicking "Recover Account" in the email, the resulting page's css is blocked due to text/plain MIME type.

Impact

The page appears unstyled.

Detail

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'https://dashboard.fission.codes/recover/'
  2. Click on 'I don't have a recovery kit'
  3. Enter account username
  4. Click 'Send Email'
  5. When 'Recover your Fission account' email arrives, click 'Recover Account' in the email
  6. See unstyled page and error in console

Screenshots

blocked-css-due-to-mime-type

Desktop (please complete the following information):

matheus23 commented 2 years ago

Can replicate this.

Workaround: Hard-reload the page.

I need help with this: I don't know how we could prevent this. I think what happens is that this nosniff header is sent when you're opening new tabs from gmail. If you just copy the link as a URL and paste it into the address bar, it works. I don't think we can make gmail not send this header.

The header basically says "don't try to figure out the MIME type from reading the file" ("sniffing the file").

Ideally, the IPFS gateway would just send the correct file type with the file, but it doesn't. Can we fix that? Can we make IPFS return application/css mime types for .css files?

May be related: https://github.com/ipfs/go-ipfs/issues/2164 Although it likely already supports css. Not sure why the go-ipfs-side sniffing doesn't work.