Switch to GET, fix forms
GET is much more better than using blobs
This commit is contained in:
9
index.js
9
index.js
@@ -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);
|
||||
|
Reference in New Issue
Block a user