Skip to content
代码片段 群组 项目
未验证 提交 25f1a1d5 编辑于 作者: Stan Hu's avatar Stan Hu
浏览文件

Fix Vite HMR Content Security Policy rules

Previously the Vite HMR Content Security Policy rules would
assume that NGINX were in the loop: the allowed hostname
would be the GitLab hostname + `/vite-dev`. However, for
users running without NGINX, the browser might try to access
the HMR host directly via `localhost` or `127.0.0.1`, which would
not be permitted by the current rules.

We fix this by using the HMR host set in the Vite GDK helper using the
`VITE_HMR_HTTP_URL` and `VITE_HMR_WS_URL` environment variables set
there. We need both HTTP and Websocket URLs because Vite will ping the
HTTP URL if the Websocket becomes unreachable.

Changelog: fixed
上级 39998720
No related branches found
No related tags found
加载中
加载中
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册