Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rest-fs

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rest-fs - npm Package Compare versions

Comparing version 0.0.9 to 0.1.0

8

fileserver.js

@@ -21,4 +21,4 @@ // fileserver

app.put("/*", putFileOrDir);
app.del("/*/", delDir);
app.del("/*", delFile);
app.del(/^\/.+\/$/, delDir);
app.del(/^\/.+[^\/]$/, delFile);
app.use(function (err, req, res, next) {

@@ -223,3 +223,3 @@ res.send(500, err);

} else if (err && err.code === 'ENOTDIR') {
sendCode(404, req, res, next, formatOutData(dirPath))(null);
sendCode(400, req, res, next, formatOutData(dirPath))(null);
} else {

@@ -246,3 +246,3 @@ sendCode(200, req, res, next, formatOutData(dirPath))(err);

} else if (err && err.code === 'EISDIR') {
sendCode(404, req, res, next, formatOutData(dirPath))(null);
sendCode(400, req, res, next, formatOutData(dirPath))(null);
} else {

@@ -249,0 +249,0 @@ sendCode(200, req, res, next, formatOutData(dirPath))(err);

{
"name": "rest-fs",
"version": "0.0.9",
"version": "0.1.0",
"description": "restful fileserver",

@@ -5,0 +5,0 @@ "main": "fileserver.js",

@@ -267,3 +267,3 @@ var Lab = require('lab');

.del(filePath+'/')
.expect(404)
.expect(400)
.end(done);

@@ -270,0 +270,0 @@ });

@@ -32,3 +32,3 @@ var Lab = require('lab');

req.send(opts);
}
}
req.end(function(err, res){

@@ -58,3 +58,3 @@ if (err) {

req.send(opts);
}
}
req.end(function(err, res){

@@ -285,3 +285,3 @@ if (err) {

if (err) { return done(err); }
Lab.expect(res.statusCode).to.equal(404);
Lab.expect(res.statusCode).to.equal(400);
done();

@@ -302,3 +302,3 @@ });

Lab.test('try to delete folder', function (done) {
Lab.test('try to delete folder with file api', function (done) {
rmFile(baseFolder, function (err, res) {

@@ -308,4 +308,6 @@ if (err) {

}
Lab.expect(res.statusCode).to.equal(403);
return done();
if (res.statusCode === 400 || res.statusCode === 403){
return done();
}
return new Error('should not delete folder');
});

@@ -333,3 +335,3 @@ });

});
Lab.after(function (done) {

@@ -336,0 +338,0 @@ cleanBase(done);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc