Revert "fix(modules/pipeline): ensure REST file API parses query parameters"
This reverts commit 043697bddc
.
This commit is contained in:
parent
fd67844235
commit
137fbf6b52
|
@ -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});
|
||||
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue