NixOS / hydra

Hydra, the Nix-based continuous build system
http://nixos.org/hydra
GNU General Public License v3.0
1.1k stars 291 forks source link

Incorrect MIME type for .css and .js files breaks rendering of HTML reports #1267

Closed knedlsepp closed 8 months ago

knedlsepp commented 1 year ago

Describe the bug HTML reports are no longer rendered correctly since https://github.com/NixOS/hydra/pull/1240 was merged, as the Content-Type of .css and .js files changed from text/css or application/javascript to text/plain.

Firefox reports:

The stylesheet was not loaded because its MIME type, "text/plain" is not "text/css"

To Reproduce

Visit https://hydra.nixos.org/build/203389362 and click Manual. Or try visiting one of the following:

Screenshots Screenshot_20221229_215348

Hydra Server:

peacememories commented 1 year ago

It seems not only the css and js MIME-types are broken. When trying to view the page on an iPhone, it is instead downloaded, because the content type header looks like this:

content-type: cannot  open  `/nix/store/mp2x9s34n3m2lyd7hk9x15l1sry5qkda-hydra-manual-0.1.20221021.312cb42/share/doc/hydra/index.html'  (No such file or directory); charset=cannot open  `/nix/store/mp2x9s34n3m2lyd7hk9x15l1sry5qkda-hydra-manual-0.1.20221021.312cb42/share/doc/hydra/index.html'  (No such file or directory)

My desktop browser ignores this, but mobile Safari refuses to open the page and instead opens the download dialog.