@@ -30,6 +30,7 @@ let clientVersion: string = require('../../../package.json').version // eslint-d
3030if ( clientVersion . includes ( '-' ) ) {
3131 clientVersion = clientVersion . slice ( 0 , clientVersion . indexOf ( '-' ) ) + 'p'
3232}
33+ const clientVersionNoMeta = clientVersion . split ( '+' ) [ 0 ]
3334let transportVersion : string = require ( '@elastic/transport/package.json' ) . version // eslint-disable-line
3435if ( transportVersion . includes ( '-' ) ) {
3536 transportVersion = transportVersion . slice ( 0 , transportVersion . indexOf ( '-' ) ) + 'p'
@@ -56,7 +57,7 @@ test('bulk index', t => {
5657 t . equal ( params . path , '/_bulk' )
5758 t . match ( params . headers , {
5859 'content-type' : 'application/vnd.elasticsearch+x-ndjson; compatible-with=8' ,
59- 'x-elastic-client-meta' : `esv=${ clientVersion } ,js=${ nodeVersion } ,t=${ transportVersion } ,hc=${ nodeVersion } ,h=bp`
60+ 'x-elastic-client-meta' : `esv=${ clientVersionNoMeta } ,js=${ nodeVersion } ,t=${ transportVersion } ,hc=${ nodeVersion } ,h=bp`
6061 } )
6162 // @ts -expect-error
6263 const [ action , payload ] = params . body . split ( '\n' )
@@ -103,7 +104,7 @@ test('bulk index', t => {
103104 t . equal ( params . path , '/_bulk' )
104105 t . match ( params . headers , { 'content-type' : 'application/vnd.elasticsearch+x-ndjson; compatible-with=8' } )
105106 t . notMatch ( params . headers , {
106- 'x-elastic-client-meta' : `esv=${ clientVersion } ,js=${ nodeVersion } ,t=${ transportVersion } ,hc=${ nodeVersion } ,h=bp`
107+ 'x-elastic-client-meta' : `esv=${ clientVersionNoMeta } ,js=${ nodeVersion } ,t=${ transportVersion } ,hc=${ nodeVersion } ,h=bp`
107108 } )
108109 // @ts -expect-error
109110 const [ action , payload ] = params . body . split ( '\n' )
@@ -1320,7 +1321,7 @@ test('Flush interval', t => {
13201321 t . equal ( params . path , '/_bulk' )
13211322 t . match ( params . headers , {
13221323 'content-type' : 'application/vnd.elasticsearch+x-ndjson; compatible-with=8' ,
1323- 'x-elastic-client-meta' : `esv=${ clientVersion } ,js=${ nodeVersion } ,t=${ transportVersion } ,hc=${ nodeVersion } ,h=bp`
1324+ 'x-elastic-client-meta' : `esv=${ clientVersionNoMeta } ,js=${ nodeVersion } ,t=${ transportVersion } ,hc=${ nodeVersion } ,h=bp`
13241325 } )
13251326 // @ts -expect-error
13261327 const [ action , payload ] = params . body . split ( '\n' )
0 commit comments