Skip to content

Commit 264e7f3

Browse files
committed
fix(httpclient): Report node.js version on user-agent
1 parent cace56c commit 264e7f3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/create-http-client.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ export default function createHttpClient (axios: Object, {space, accessToken, in
2323
headers['Content-Type'] = 'application/vnd.contentful.delivery.v1+json'
2424
headers['X-Contentful-User-Agent'] = 'contentful.js/' + packageFile.version
2525

26+
if (process && process.release && process.release.name === 'node') {
27+
headers['user-agent'] = 'node.js/' + process.version
28+
}
29+
2630
return axios.create({
2731
baseURL: `${insecure ? 'http' : 'https'}://${hostname}:${port}/spaces/${space}/`,
2832
headers: headers,

0 commit comments

Comments
 (0)