vuejs / devtools-v6

⚙️ Browser devtools extension for debugging Vue.js applications.
https://devtools-v6.vuejs.org/
MIT License
24.68k stars 4.14k forks source link

Devtools not returning correct mimetype in electron #2030

Open mellester opened 1 year ago

mellester commented 1 year ago

Vue devtools version

6.5.0

Link to minimal reproduction

https://github.com/vuejs/devtools/blob/main/packages/shell-electron/server.js

Steps to reproduce & screenshots

Start the electron app. And navigate in a browser to http://localhost:8098/ Check the mimetype of the page.

What is expected?

The mime type should be 'application/javascript;'

What is actually happening?

The returned mimetype is 'text/html'.

Wich means if <script src="http://localhost:8098"></script> will not work if strict mime typing is enabled.

System Info

System:
    OS: Linux 5.15 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
    CPU: (8) x64 Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz
    Memory: 2.54 GB / 7.68 GB
    Container: Yes
    Shell: 5.8.1 - /usr/bin/zsh
  Binaries:
    Node: 18.9.1 - /usr/bin/node
    Yarn: 1.22.19 - /usr/bin/yarn
    npm: 8.19.1 - /usr/bin/npm

Any additional comments?

adding to main/packages/shell-electron/server.js:19 a line like. res.contentType('application/javascript') Could proably fix it.