Fixes #2324
(cherry picked from commit 172180cb21)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
This commit is contained in:
committed by
GitHub
parent
07f75a4d9d
commit
d540d7fdb2
@ -287,7 +287,14 @@ export default class Client extends API {
|
||||
}
|
||||
|
||||
if (options.enableMetaHeader) {
|
||||
options.headers['x-elastic-client-meta'] = `es=${clientVersion},js=${nodeVersion},t=${transportVersion},hc=${nodeVersion}`
|
||||
let clientMeta = `es=${clientVersion},js=${nodeVersion},t=${transportVersion}`
|
||||
if (options.Connection === UndiciConnection) {
|
||||
clientMeta += `,un=${nodeVersion}`
|
||||
} else {
|
||||
// assumes HttpConnection
|
||||
clientMeta += `,hc=${nodeVersion}`
|
||||
}
|
||||
options.headers['x-elastic-client-meta'] = clientMeta
|
||||
}
|
||||
|
||||
this.name = options.name
|
||||
|
||||
Reference in New Issue
Block a user