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

http-server

Package Overview
Dependencies
Maintainers
4
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-server - npm Package Compare versions

Comparing version 0.5.1 to 0.5.2

17

lib/http-server.js

@@ -21,5 +21,16 @@ var fs = require('fs'),

}
if (options.headers) {
this.headers = options.headers;
}
this.cache = options.cache || 3600; // in seconds.
this.autoIndex = options.autoIndex !== false;
if (options.ext) {
this.ext = options.ext === true
? 'html'
: options.ext;
}
this.server = union.createServer({

@@ -29,5 +40,7 @@ before: [

autoIndex: this.autoIndex,
cache: this.cache
cache: this.cache,
defaultExt: this.ext
})
]
],
headers: this.headers || {}
});

@@ -34,0 +47,0 @@ };

5

package.json
{
"name": "http-server",
"version": "0.5.1",
"version": "0.5.2",
"author": "Nodejitsu <support@nodejitsu.com>",

@@ -57,3 +57,4 @@ "description": "a simple zero-configuration command-line http server",

"union": "0.1.x",
"ecstatic": "0.1.x"
"ecstatic": "0.1.x",
"portfinder": "~0.2.1"
},

@@ -60,0 +61,0 @@ "devDependencies": {

@@ -14,3 +14,7 @@ var assert = require('assert'),

var server = httpServer.createServer({
root: root
root: root,
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Credentials': 'true'
}
});

@@ -56,5 +60,13 @@ server.listen(8080);

}
},
'and options include custom set http-headers': {
topic: function () {
request('http://127.0.0.1:8080/', this.callback);
},
'should respond with headers set in options': function (err, res, body) {
assert.equal(res.headers['access-control-allow-origin'], '*');
assert.equal(res.headers['access-control-allow-credentials'], 'true');
}
}
}
}).export(module);

Sorry, the diff of this file is not supported yet

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