fix(client): allow configurable Vite allowed hosts
Vite >=4.3 rejects requests with a Host header not in the allowlist, which broke status-page submissions and dev-server access for users serving Checkmate behind a reverse proxy after upgrading. Adds VITE_ALLOWED_HOSTS env var (comma-separated list). When unset, falls back to allowing all hosts so existing self-hosted deployments keep working without changes. Closes #3397 Closes #2951
This commit is contained in:
1 parent
6ed0818bad
commit
dbccce445b
1 file changed
+9
@@ -9,11 +9,20 @@ const __dirname = path.dirname(__filename);
|
|||||||
export default defineConfig(({}) => {
|
export default defineConfig(({}) => {
|
||||||
let version = "3.6.1";
|
let version = "3.6.1";
|
||||||
|
|
||||||
|
const allowedHosts = process.env.VITE_ALLOWED_HOSTS
|
||||||
|
? process.env.VITE_ALLOWED_HOSTS.split(",").map((h) => h.trim())
|
||||||
|
: true;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
base: "/",
|
base: "/",
|
||||||
plugins: [svgr(), react()],
|
plugins: [svgr(), react()],
|
||||||
server: {
|
server: {
|
||||||
host: true,
|
host: true,
|
||||||
|
allowedHosts,
|
||||||
|
},
|
||||||
|
preview: {
|
||||||
|
host: true,
|
||||||
|
allowedHosts,
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
|
|||||||
Reference in new issue
Block a user