We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2a519a1 commit 58ff849Copy full SHA for 58ff849
packages/vite/src/node/server/index.ts
@@ -1,6 +1,7 @@
1
import path from 'node:path'
2
import type * as net from 'node:net'
3
import { get as httpGet } from 'node:http'
4
+import { get as httpsGet } from 'node:https'
5
import type * as http from 'node:http'
6
import { performance } from 'node:perf_hooks'
7
import type { Http2SecureServer } from 'node:http2'
@@ -497,7 +498,9 @@ export async function _createServer(
497
498
// preTransformRequests needs to be enabled for this optimization.
499
if (server.config.server.preTransformRequests) {
500
setTimeout(() => {
- httpGet(
501
+ const getMethod = path.startsWith('https:') ? httpsGet : httpGet
502
+
503
+ getMethod(
504
path,
505
{
506
headers: {
0 commit comments