Skip to content

Commit 8204bc5

Browse files
committed
esm: expose User-Agent header
1 parent c755ccb commit 8204bc5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/internal/modules/esm/fetch_module.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ function HTTPSGet(url, opts) {
5252
});
5353
return https.get(url, {
5454
agent: HTTPSAgent,
55+
headers: {
56+
'User-Agent': `Node.js/${process.version}`,
57+
},
5558
...opts,
5659
});
5760
}
@@ -64,6 +67,9 @@ function HTTPGet(url, opts) {
6467
});
6568
return http.get(url, {
6669
agent: HTTPAgent,
70+
headers: {
71+
'User-Agent': `Node.js/${process.version}`,
72+
},
6773
...opts,
6874
});
6975
}

0 commit comments

Comments
 (0)