Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

fix: disable Helmet HSTS when FORCE_HTTPS is not set — fixes #58 #59

Maurice48e1b732d864
diff --git a/server/src/index.ts b/server/src/index.ts
index 7b1b09a42..74af7042d 100644
--- a/server/src/index.ts
+++ b/server/src/index.ts
@@ -63,6 +63,7 @@ app.use(helmet({
}
},
crossOriginEmbedderPolicy: false,
+ hsts: process.env.FORCE_HTTPS === 'true' ? { maxAge: 31536000, includeSubDomains: false } : false,
}));
// Redirect HTTP to HTTPS (opt-in via FORCE_HTTPS=true)
if (process.env.FORCE_HTTPS === 'true') {