Html file gets opened as txt through the gateway


For a payment uri to open. This doesn’t work

But the cryptodevs invite to discord will work that’s the same other than uri

It’s like uri makes it open as .txt

Both were put up as .html

Hi @pr0toshi,

This is puzzling. The only difference I find is that the first link reports as HTML document, UTF-8 Unicode (with BOM) text, with CRLF line terminators while the second is HTML document, ASCII text.

This must be tripping the file type detection so that in the first case it sets Content-Type as text/plain while in the second it correctly sets text/html.

I suggest:

  • Try to get plain ascii encoding for the first file and re-add.
  • Probably the best approach in general is to add an index.html file wrapped in a folder, and use the folder hash. That works for me for the first file: is a folder containing a single index.html (which is QmTafuGvQQarbk4XR7Q9ZkP1ysuYGDWhkrh4udwgzEq6cM) (ipfs add -w index.html).