Skip to content

Commit 3cf3f93

Browse files
authored
fix: add detection for --experimental-https flag (#14085)
Follow up from #14053 Add detection for `--experimental-https` flag based on `process.argv` which may not be reliable so we're keeping the env var toggle in as well
1 parent 709ee58 commit 3cf3f93

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/payload/src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,9 @@ export const getPayload = async (
11201120
) {
11211121
try {
11221122
const port = process.env.PORT || '3000'
1123-
const protocol = process.env.USE_HTTPS === 'true' ? 'wss' : 'ws'
1123+
const hasHTTPS =
1124+
process.env.USE_HTTPS === 'true' || process.argv.includes('--experimental-https')
1125+
const protocol = hasHTTPS ? 'wss' : 'ws'
11241126

11251127
const path = '/_next/webpack-hmr'
11261128
// The __NEXT_ASSET_PREFIX env variable is set for both assetPrefix and basePath (tested in Next.js 15.1.6)

0 commit comments

Comments
 (0)