-
Notifications
You must be signed in to change notification settings - Fork 516
Open
Labels
Description
When running sanity dev with HTTPS configured via vite.server.https in sanity.cli.ts, the startup message incorrectly shows:
│ Sanity Studio using vite@x.x.x ready in XXms and running at **http://**localhost:3333/
The server is actually running on HTTPS, so the URL should use https://.
Configuration
// sanity.cli.ts
export default defineCliConfig({
vite: {
server: {
https: {
key: "path/to/key.pem",
cert: "path/to/cert.pem",
},
},
},
});Suggested fix
In packages/sanity/src/_internal/cli/actions/dev/devAction.ts, the URL protocol is hardcoded as http://:
const url = `http://${httpHost || 'localhost'}:${port}${config.basePath}`It should check the Vite server config:
- const url = `http://${httpHost || 'localhost'}:${port}${config.basePath}`
+ const protocol = server.config.server.https ? 'https' : 'http'
+ const url = `${protocol}://${httpHost || 'localhost'}:${port}${config.basePath}`The same issue exists in getDashboardAppURL where http:// is also hardcoded.
Versions
- sanity: 5.7.0
- vite: 7.3.1
Reactions are currently unavailable