diff --git a/lib/handlers/elastic_bulk.js b/lib/handlers/elastic_bulk.js index 3d3bc8f8..7914694c 100644 --- a/lib/handlers/elastic_bulk.js +++ b/lib/handlers/elastic_bulk.js @@ -26,17 +26,7 @@ async function handler (req, res) { const docTarget = req.params.target || false - let streams - if ( - req.headers['content-type'] && - req.headers['content-type'].indexOf('application/x-ndjson') > -1 - ) { - // ndjson body - streams = req.body.split(/\n/) - } else { - // assume ndjson raw body - streams = req.body.split(/\n/) - } + const streams = req.body.split(/\n/) let lastTags = false const promises = [] if (streams) { diff --git a/qryn_node.js b/qryn_node.js index 01c8e71b..95405451 100755 --- a/qryn_node.js +++ b/qryn_node.js @@ -243,11 +243,9 @@ let fastify = require('fastify')({ }) const handlerElasticBulk = require('./lib/handlers/elastic_bulk.js').bind(this) writerMode && fastify.post('/_bulk', handlerElasticBulk, { - 'application/json': jsonParser, '*': rawStringParser }) writerMode && fastify.post('/:target/_bulk', handlerElasticBulk, { - 'application/json': jsonParser, '*': rawStringParser })