Add api compatibility header support (#1478)
This commit is contained in:
committed by
GitHub
parent
101a13f63e
commit
4073d60b97
4
index.js
4
index.js
@ -116,6 +116,10 @@ class Client extends ESAPI {
|
||||
disablePrototypePoisoningProtection: false
|
||||
}, opts)
|
||||
|
||||
if (process.env.ELASTIC_CLIENT_APIVERSIONING === 'true') {
|
||||
options.headers = Object.assign({ accept: 'application/vnd.elasticsearch+json; compatible-with=7' }, options.headers)
|
||||
}
|
||||
|
||||
this[kInitialOptions] = options
|
||||
this[kExtensions] = []
|
||||
this.name = options.name
|
||||
|
||||
Reference in New Issue
Block a user