mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-01-09 13:36:14 +00:00
Revert "fix(modules/pipeline): ensure REST file API parses query parameters"
This reverts commit 043697bddccf2b5f47e649eb885b2ece53a1d825.
This commit is contained in:
parent
fd67844235
commit
137fbf6b52
@ -28,14 +28,12 @@ class Pipeline {
|
|||||||
'get',
|
'get',
|
||||||
'/embark-api/file',
|
'/embark-api/file',
|
||||||
(req, res) => {
|
(req, res) => {
|
||||||
const queryParams = JSON.parse(req.query.params);
|
if (!fs.existsSync(req.query.path) || !req.query.path.startsWith(fs.dappPath())) {
|
||||||
|
|
||||||
if (!fs.existsSync(queryParams.path) || !queryParams.path.startsWith(fs.dappPath())) {
|
|
||||||
return res.send({error: 'Path is invalid'});
|
return res.send({error: 'Path is invalid'});
|
||||||
}
|
}
|
||||||
const name = path.basename(queryParams.path);
|
const name = path.basename(req.query.path);
|
||||||
const content = fs.readFileSync(queryParams.path, 'utf8');
|
const content = fs.readFileSync(req.query.path, 'utf8');
|
||||||
res.send({name, content, path: queryParams.path});
|
res.send({name, content, path: req.query.path});
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user