Switch to GET, fix forms

GET is much more better than using blobs
This commit is contained in:
2019-05-25 13:37:19 +05:30
parent 57a43aa643
commit aa46296f53
6 changed files with 66 additions and 8 deletions

View File

@@ -18,12 +18,10 @@ app.use(bodyParser.json())
let inDir = (dircheck,dirmain) => !path.relative(path.normalize(dircheck), dirmain).startsWith('..')
//Get folder details
app.post('/files/cat',(req,res,next)=>{
console.log(req.body)
const location = processing.mergedir(req.body.loc,settings)
app.get('/files/cat',(req,res,next)=>{
//console.log(req.body)
const location = processing.mergedir(req.query.loc,settings)
//const nloc = path.normalize(req.body.loc);
const nloc = path.normalize(path.relative(settings.dirname,location))
if(inDir(settings.dirname,location)){
@@ -31,7 +29,6 @@ app.post('/files/cat',(req,res,next)=>{
}
})
app.post('/files/ls',(req,res,next)=>{
const location = processing.mergedir(req.body.loc,settings)
//const nloc = path.normalize(req.body.loc);