MiniProfiler / dotnet

A simple but effective mini-profiler for ASP.NET (and Core) websites
https://miniprofiler.com/dotnet/
MIT License
2.93k stars 603 forks source link

includes.min.js is served with the incorrect mime type of text/html #663

Closed oferns closed 1 year ago

oferns commented 1 year ago

HandleRequest in the MiniProfiler Middleware does not set the correct mime type of text/javascript when serving the file. This, combined with the X-Content-Type-Options: nosniff results in the file not being loaded

Chromium: Refused to execute script from 'https://localhost:5001/p/includes.min.js?v=4.3.17+2bd2031370' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

Firefox: The resource from “https://localhost:5001/p/includes.min.js?v=4.3.17+2bd2031370” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).

The fix is simple and I will submit a PR shortly

EDIT: My bad. I changed the RouteBasePath, Closing. Apologies