Skip to content

Commit f433729

Browse files
committed
Make __dirname declaration cross-platform
See nodejs/node#37845
1 parent 29e9b30 commit f433729

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/staging/monkeyPatchTls.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
import fs from 'fs'
1111
import tls from 'tls'
1212
import path from 'path'
13+
import { fileURLToPath } from 'url'
1314

14-
const __dirname = new URL('.', import.meta.url).pathname
15+
const __dirname = fileURLToPath(new URL('.', import.meta.url))
1516

1617
/**
1718
* Monkey patches the TLS module to accept the Let’s Encrypt staging certificate.

0 commit comments

Comments
 (0)