don't pass headers through to jobs
This commit is contained in:
@@ -47,8 +47,6 @@ export default class Job extends events.EventEmitter {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (options.headers) indexParams.headers = options.headers;
|
|
||||||
|
|
||||||
this.ready = createIndex(this.client, this.index, this.doctype, this.indexSettings)
|
this.ready = createIndex(this.client, this.index, this.doctype, this.indexSettings)
|
||||||
.then(() => this.client.index(indexParams))
|
.then(() => this.client.index(indexParams))
|
||||||
.then((doc) => {
|
.then((doc) => {
|
||||||
|
|||||||
@@ -210,15 +210,6 @@ describe('Job Class', function () {
|
|||||||
expect(indexArgs.body).to.have.property('priority', minPriority);
|
expect(indexArgs.body).to.have.property('priority', minPriority);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should pass headers to the client', function () {
|
|
||||||
const headers = { authorization: 'Basic dXNlcjpwYXNzd29yZA==' };
|
|
||||||
const job = new Job(client, index, type, payload, Object.assign(options, { headers }));
|
|
||||||
return job.ready.then(() => {
|
|
||||||
const indexArgs = validateDoc(client.index);
|
|
||||||
expect(indexArgs).to.have.property('headers', headers);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('custom client', function () {
|
describe('custom client', function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user