@@ -56,7 +56,7 @@ test('bulk index', t => {
56
56
onRequest ( params ) {
57
57
t . equal ( params . path , '/_bulk' )
58
58
t . match ( params . headers , {
59
- 'content-type' : 'application/vnd.elasticsearch+ x-ndjson; compatible-with=8 ' ,
59
+ 'content-type' : 'application/x-ndjson' ,
60
60
'x-elastic-client-meta' : `esv=${ clientVersionNoMeta } ,js=${ nodeVersion } ,t=${ transportVersion } ,hc=${ nodeVersion } ,h=bp`
61
61
} )
62
62
// @ts -expect-error
@@ -103,7 +103,7 @@ test('bulk index', t => {
103
103
const MockConnection = connection . buildMockConnection ( {
104
104
onRequest ( params ) {
105
105
t . equal ( params . path , '/_bulk' )
106
- t . match ( params . headers , { 'content-type' : 'application/vnd.elasticsearch+ x-ndjson; compatible-with=8 ' } )
106
+ t . match ( params . headers , { 'content-type' : 'application/x-ndjson' } )
107
107
t . notMatch ( params . headers , {
108
108
'x-elastic-client-meta' : `esv=${ clientVersionNoMeta } ,js=${ nodeVersion } ,t=${ transportVersion } ,hc=${ nodeVersion } ,h=bp`
109
109
} )
@@ -150,7 +150,7 @@ test('bulk index', t => {
150
150
const MockConnection = connection . buildMockConnection ( {
151
151
onRequest ( params ) {
152
152
t . equal ( params . path , '/_bulk' )
153
- t . match ( params . headers , { 'content-type' : 'application/vnd.elasticsearch+ x-ndjson; compatible-with=8 ' } )
153
+ t . match ( params . headers , { 'content-type' : 'application/x-ndjson' } )
154
154
// @ts -expect-error
155
155
t . equal ( params . body . split ( '\n' ) . filter ( Boolean ) . length , 6 )
156
156
return { body : { errors : false , items : new Array ( 3 ) . fill ( { } ) } }
@@ -192,7 +192,7 @@ test('bulk index', t => {
192
192
const MockConnection = connection . buildMockConnection ( {
193
193
onRequest ( params ) {
194
194
t . equal ( params . path , '/_bulk' )
195
- t . match ( params . headers , { 'content-type' : 'application/vnd.elasticsearch+ x-ndjson; compatible-with=8 ' } )
195
+ t . match ( params . headers , { 'content-type' : 'application/x-ndjson' } )
196
196
// @ts -expect-error
197
197
const [ action , payload ] = params . body . split ( '\n' )
198
198
t . same ( JSON . parse ( action ) , { index : { _index : 'test' , _id : count } } )
@@ -238,7 +238,7 @@ test('bulk index', t => {
238
238
t . test ( 'Should perform a bulk request (retry)' , async t => {
239
239
async function handler ( req : http . IncomingMessage , res : http . ServerResponse ) {
240
240
t . equal ( req . url , '/_bulk' )
241
- t . match ( req . headers , { 'content-type' : 'application/vnd.elasticsearch+ x-ndjson; compatible-with=8 ' } )
241
+ t . match ( req . headers , { 'content-type' : 'application/x-ndjson' } )
242
242
243
243
let body = ''
244
244
req . setEncoding ( 'utf8' )
@@ -359,7 +359,7 @@ test('bulk index', t => {
359
359
t . test ( 'Should perform a bulk request (failure)' , async t => {
360
360
async function handler ( req : http . IncomingMessage , res : http . ServerResponse ) {
361
361
t . equal ( req . url , '/_bulk' )
362
- t . match ( req . headers , { 'content-type' : 'application/vnd.elasticsearch+ x-ndjson; compatible-with=8 ' } )
362
+ t . match ( req . headers , { 'content-type' : 'application/x-ndjson' } )
363
363
364
364
let body = ''
365
365
req . setEncoding ( 'utf8' )
@@ -503,7 +503,7 @@ test('bulk index', t => {
503
503
t . test ( 'Should abort a bulk request' , async t => {
504
504
async function handler ( req : http . IncomingMessage , res : http . ServerResponse ) {
505
505
t . equal ( req . url , '/_bulk' )
506
- t . match ( req . headers , { 'content-type' : 'application/vnd.elasticsearch+ x-ndjson; compatible-with=8 ' } )
506
+ t . match ( req . headers , { 'content-type' : 'application/x-ndjson' } )
507
507
508
508
let body = ''
509
509
req . setEncoding ( 'utf8' )
@@ -606,7 +606,7 @@ test('bulk index', t => {
606
606
const MockConnection = connection . buildMockConnection ( {
607
607
onRequest ( params ) {
608
608
t . equal ( params . path , '/_bulk' )
609
- t . match ( params . headers , { 'content-type' : 'application/vnd.elasticsearch+ x-ndjson; compatible-with=8 ' } )
609
+ t . match ( params . headers , { 'content-type' : 'application/x-ndjson' } )
610
610
// @ts -expect-error
611
611
const [ action , payload ] = params . body . split ( '\n' )
612
612
t . same ( JSON . parse ( action ) , { index : { _index : 'test' , _id : count } } )
@@ -660,7 +660,7 @@ test('bulk index', t => {
660
660
const MockConnection = connection . buildMockConnection ( {
661
661
onRequest ( params ) {
662
662
t . equal ( params . path , '/_bulk' )
663
- t . match ( params . headers , { 'content-type' : 'application/vnd.elasticsearch+ x-ndjson; compatible-with=8 ' } )
663
+ t . match ( params . headers , { 'content-type' : 'application/x-ndjson' } )
664
664
// @ts -expect-error
665
665
const [ action , payload ] = params . body . split ( '\n' )
666
666
t . same ( JSON . parse ( action ) , { index : { _index : 'test' } } )
@@ -718,7 +718,7 @@ test('bulk create', t => {
718
718
const MockConnection = connection . buildMockConnection ( {
719
719
onRequest ( params ) {
720
720
t . equal ( params . path , '/_bulk' )
721
- t . match ( params . headers , { 'content-type' : 'application/vnd.elasticsearch+ x-ndjson; compatible-with=8 ' } )
721
+ t . match ( params . headers , { 'content-type' : 'application/x-ndjson' } )
722
722
// @ts -expect-error
723
723
const [ action , payload ] = params . body . split ( '\n' )
724
724
t . same ( JSON . parse ( action ) , { create : { _index : 'test' , _id : count } } )
@@ -769,7 +769,7 @@ test('bulk update', t => {
769
769
const MockConnection = connection . buildMockConnection ( {
770
770
onRequest ( params ) {
771
771
t . equal ( params . path , '/_bulk' )
772
- t . match ( params . headers , { 'content-type' : 'application/vnd.elasticsearch+ x-ndjson; compatible-with=8 ' } )
772
+ t . match ( params . headers , { 'content-type' : 'application/x-ndjson' } )
773
773
// @ts -expect-error
774
774
const [ action , payload ] = params . body . split ( '\n' )
775
775
t . same ( JSON . parse ( action ) , { update : { _index : 'test' , _id : count } } )
@@ -819,7 +819,7 @@ test('bulk update', t => {
819
819
const MockConnection = connection . buildMockConnection ( {
820
820
onRequest ( params ) {
821
821
t . equal ( params . path , '/_bulk' )
822
- t . match ( params . headers , { 'content-type' : 'application/vnd.elasticsearch+ x-ndjson; compatible-with=8 ' } )
822
+ t . match ( params . headers , { 'content-type' : 'application/x-ndjson' } )
823
823
// @ts -expect-error
824
824
const [ action , payload ] = params . body . split ( '\n' )
825
825
t . same ( JSON . parse ( action ) , { update : { _index : 'test' , _id : count } } )
@@ -867,7 +867,7 @@ test('bulk update', t => {
867
867
const MockConnection = connection . buildMockConnection ( {
868
868
onRequest ( params ) {
869
869
t . equal ( params . path , '/_bulk' )
870
- t . match ( params . headers , { 'content-type' : 'application/vnd.elasticsearch+ x-ndjson; compatible-with=8 ' } )
870
+ t . match ( params . headers , { 'content-type' : 'application/x-ndjson' } )
871
871
// @ts -expect-error
872
872
const [ action , payload ] = params . body . split ( '\n' )
873
873
t . same ( JSON . parse ( action ) , { update : { _index : 'test' , _id : count } } )
@@ -922,7 +922,7 @@ test('bulk delete', t => {
922
922
const MockConnection = connection . buildMockConnection ( {
923
923
onRequest ( params ) {
924
924
t . equal ( params . path , '/_bulk' )
925
- t . match ( params . headers , { 'content-type' : 'application/vnd.elasticsearch+ x-ndjson; compatible-with=8 ' } )
925
+ t . match ( params . headers , { 'content-type' : 'application/x-ndjson' } )
926
926
// @ts -expect-error
927
927
t . same ( JSON . parse ( params . body ) , { delete : { _index : 'test' , _id : count ++ } } )
928
928
return { body : { errors : false , items : [ { } ] } }
@@ -966,7 +966,7 @@ test('bulk delete', t => {
966
966
t . test ( 'Should perform a bulk request (failure)' , async t => {
967
967
async function handler ( req : http . IncomingMessage , res : http . ServerResponse ) {
968
968
t . equal ( req . url , '/_bulk' )
969
- t . match ( req . headers , { 'content-type' : 'application/vnd.elasticsearch+ x-ndjson; compatible-with=8 ' } )
969
+ t . match ( req . headers , { 'content-type' : 'application/x-ndjson' } )
970
970
971
971
let body = ''
972
972
req . setEncoding ( 'utf8' )
@@ -1115,7 +1115,7 @@ test('transport options', t => {
1115
1115
1116
1116
if ( params . path === '/_bulk' ) {
1117
1117
t . match ( params . headers , {
1118
- 'content-type' : 'application/vnd.elasticsearch+ x-ndjson; compatible-with=8 ' ,
1118
+ 'content-type' : 'application/x-ndjson' ,
1119
1119
foo : 'bar'
1120
1120
} )
1121
1121
return { body : { errors : false , items : [ { } ] } }
@@ -1231,7 +1231,7 @@ test('Flush interval', t => {
1231
1231
const MockConnection = connection . buildMockConnection ( {
1232
1232
onRequest ( params ) {
1233
1233
t . equal ( params . path , '/_bulk' )
1234
- t . match ( params . headers , { 'content-type' : 'application/vnd.elasticsearch+ x-ndjson; compatible-with=8 ' } )
1234
+ t . match ( params . headers , { 'content-type' : 'application/x-ndjson' } )
1235
1235
// @ts -expect-error
1236
1236
const [ action , payload ] = params . body . split ( '\n' )
1237
1237
t . same ( JSON . parse ( action ) , { index : { _index : 'test' } } )
@@ -1285,7 +1285,7 @@ test('Flush interval', t => {
1285
1285
onRequest ( params ) {
1286
1286
t . ok ( count < 2 )
1287
1287
t . equal ( params . path , '/_bulk' )
1288
- t . match ( params . headers , { 'content-type' : 'application/vnd.elasticsearch+ x-ndjson; compatible-with=8 ' } )
1288
+ t . match ( params . headers , { 'content-type' : 'application/x-ndjson' } )
1289
1289
// @ts -expect-error
1290
1290
const [ action , payload ] = params . body . split ( '\n' )
1291
1291
t . same ( JSON . parse ( action ) , { index : { _index : 'test' } } )
@@ -1345,7 +1345,7 @@ test('Flush interval', t => {
1345
1345
onRequest ( params ) {
1346
1346
t . equal ( params . path , '/_bulk' )
1347
1347
t . match ( params . headers , {
1348
- 'content-type' : 'application/vnd.elasticsearch+ x-ndjson; compatible-with=8 ' ,
1348
+ 'content-type' : 'application/x-ndjson' ,
1349
1349
'x-elastic-client-meta' : `esv=${ clientVersionNoMeta } ,js=${ nodeVersion } ,t=${ transportVersion } ,hc=${ nodeVersion } ,h=bp`
1350
1350
} )
1351
1351
// @ts -expect-error
0 commit comments