in reply to Display bundled html files on MetaCPAN

In the Olden Days (IE6 or so) some browsers took the liberty to guess the content type, and override the header provided by the server.... we won't get that back.

MetaCPAN does recognize content types for images, as for example in Prima's form builder, so maybe they could be nudged into mapping .html files to Content-type: text/html.

In the meantime, since this is about Emacs, you can do

(shr-render-buffer (url-retrieve-synchronously "https://fastapi.metacpan.org/source/SEANO/Sepia-0.992/Sepia.html"))

...and read the content in Emacs. This is a bit dirty because it also renders the HTTP headers, but I'm too lazy to fix that right now. If you activate perl-doc-mode in that buffer, you can also get an imenu table of contents.

Replies are listed 'Best First'.
Re^2: Display bundled html files on MetaCPAN
by tobyink (Canon) on Mar 10, 2023 at 14:06 UTC

    MetaCPAN does recognize content types for images, as for example in Prima's form builder, so maybe they could be nudged into mapping .html files to Content-type: text/html.

    This has XSS implications.

      > This has XSS implications

      I'm sure I was able to trigger a referring of HTML files on GitHub.

      So either

      • they ignore XSS,
      • they have found a way to control it or
      • or they delegate the responsibility to the user who clicked the button

      Cheers Rolf
      (addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
      Wikisyntax for the Monastery

        GitHub have a whole different domain name (raw.githubusercontent.com) for serving raw HTML files, meaning that HTML served that way can't access Github's cookies, etc.