mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
return from handler in empty payload check to prevent error from being thrown
This commit is contained in:
parent
a2ba98c360
commit
08d6685a41
2 changed files with 2 additions and 2 deletions
|
@ -96,7 +96,7 @@ export default function (server) {
|
|||
path: '/api/index-patterns',
|
||||
method: 'POST',
|
||||
handler: function (req, reply) {
|
||||
if (_.isEmpty(req.payload)) { reply(Boom.badRequest('Payload required')); }
|
||||
if (_.isEmpty(req.payload)) { return reply(Boom.badRequest('Payload required')); }
|
||||
|
||||
const client = server.plugins.elasticsearch.client;
|
||||
const indexPattern = _.cloneDeep(req.payload);
|
||||
|
|
|
@ -27,7 +27,7 @@ define(function (require) {
|
|||
|
||||
bdd.describe('POST index-patterns', function postIndexPatterns() {
|
||||
|
||||
bdd.it('missing payload should return 400', function missingPayload() {
|
||||
bdd.it('should return 400 for a missing payload', function missingPayload() {
|
||||
return request.post('/index-patterns')
|
||||
.send({})
|
||||
.expect(400);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue