fix(vite): set server.cors.origin #2981

Merged
h-banii merged 1 commit from fix/vite-cors into master 2025-02-16 04:23:36 +00:00
h-banii commented 2025-02-15 18:02:04 +00:00 (Migrated from github.com)

Fixes #2979


Vite v6.0.9 changed the default value of server.cors from true to false (security advisory: https://github.com/vitejs/vite/security/advisories/GHSA-vg6x-rcgg-rjx6 )

As a consequence, we get some CORS erros and the plugins are not applied to the page

Access to script at 'http://localhost:5173/@vite/client' from origin 'https://music.youtube.com'
has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the
requested resource.

Access to script at 'http://localhost:5173/renderer.ts' from origin 'https://music.youtube.com'
has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the
requested resource.

To fix that, this PR sets server.cors.origin to https://music.youtube.com

Fixes #2979 <hr> Vite `v6.0.9` changed the default value of `server.cors` from `true` to `false` (security advisory: https://github.com/vitejs/vite/security/advisories/GHSA-vg6x-rcgg-rjx6 ) As a consequence, we get some CORS erros and the plugins are not applied to the page ``` Access to script at 'http://localhost:5173/@vite/client' from origin 'https://music.youtube.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Access to script at 'http://localhost:5173/renderer.ts' from origin 'https://music.youtube.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. ``` <hr> To fix that, this PR sets `server.cors.origin` to `https://music.youtube.com`
JellyBrick (Migrated from github.com) approved these changes 2025-02-16 04:23:18 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: YTMD/youtube-music#2981
No description provided.