From 137fbf6b52a697b00067a156a5e402548b196189 Mon Sep 17 00:00:00 2001 From: Pascal Precht Date: Mon, 22 Oct 2018 10:08:36 +0200 Subject: [PATCH] Revert "fix(modules/pipeline): ensure REST file API parses query parameters" This reverts commit 043697bddccf2b5f47e649eb885b2ece53a1d825. --- lib/modules/pipeline/index.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/modules/pipeline/index.js b/lib/modules/pipeline/index.js index dbcd0a71..4899e0e6 100644 --- a/lib/modules/pipeline/index.js +++ b/lib/modules/pipeline/index.js @@ -28,14 +28,12 @@ class Pipeline { 'get', '/embark-api/file', (req, res) => { - const queryParams = JSON.parse(req.query.params); - - if (!fs.existsSync(queryParams.path) || !queryParams.path.startsWith(fs.dappPath())) { + if (!fs.existsSync(req.query.path) || !req.query.path.startsWith(fs.dappPath())) { return res.send({error: 'Path is invalid'}); } - const name = path.basename(queryParams.path); - const content = fs.readFileSync(queryParams.path, 'utf8'); - res.send({name, content, path: queryParams.path}); + const name = path.basename(req.query.path); + const content = fs.readFileSync(req.query.path, 'utf8'); + res.send({name, content, path: req.query.path}); } );