[bfetch] Pass compress flag in query instead of headers (#113929)

This commit is contained in:
Anton Dosov 2021-10-11 17:30:18 +02:00 committed by GitHub
parent 53109bdcd5
commit f944389352
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 56 additions and 150 deletions

View file

@ -29,28 +29,25 @@ export default function ({ getService }: FtrProviderContext) {
describe('bsearch', () => {
describe('post', () => {
it('should return 200 a single response', async () => {
const resp = await supertest
.post(`/internal/bsearch`)
.set({ 'X-Chunk-Encoding': '' })
.send({
batch: [
{
request: {
params: {
index: '.kibana',
body: {
query: {
match_all: {},
},
const resp = await supertest.post(`/internal/bsearch`).send({
batch: [
{
request: {
params: {
index: '.kibana',
body: {
query: {
match_all: {},
},
},
},
options: {
strategy: 'es',
},
},
],
});
options: {
strategy: 'es',
},
},
],
});
const jsonBody = parseBfetchResponse(resp);
@ -62,28 +59,25 @@ export default function ({ getService }: FtrProviderContext) {
});
it('should return 200 a single response from compressed', async () => {
const resp = await supertest
.post(`/internal/bsearch`)
.set({ 'X-Chunk-Encoding': 'deflate' })
.send({
batch: [
{
request: {
params: {
index: '.kibana',
body: {
query: {
match_all: {},
},
const resp = await supertest.post(`/internal/bsearch?compress=true`).send({
batch: [
{
request: {
params: {
index: '.kibana',
body: {
query: {
match_all: {},
},
},
},
options: {
strategy: 'es',
},
},
],
});
options: {
strategy: 'es',
},
},
],
});
const jsonBody = parseBfetchResponse(resp, true);