Socket
Socket
Sign inDemoInstall

router

Package Overview
Dependencies
1
Maintainers
0
Versions
65
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.8 to 0.3.0

tmp.js

19

index.js

@@ -79,2 +79,7 @@ var common = require('common');

return function(pattern, rewrite, fn) {
if (arguments.length === 1) {
fn = pattern;
rewrite = undefined;
pattern = /.*/;
}
if (!fn) {

@@ -116,3 +121,11 @@ fn = rewrite;

that.file = function(pattern, rewrite) {
that.file = function(pattern, rewrite, options) {
if (arguments.length === 1 || typeof rewrite === 'object') {
options = rewrite;
rewrite = pattern;
pattern = /(.*)/g;
}
options = options || {};
options.status = options.status || 200;
that.get(pattern, rewrite, function(request, response) {

@@ -133,5 +146,3 @@ var url = path.normalize(request.url.split('?')[0]);

}
response.writeHead(200, {
'content-type':mimes.resolve(url)
});
response.writeHead(options.status, {'content-type':mimes.resolve(url)});
response.end(buffer);

@@ -138,0 +149,0 @@ });

{
"name":"router",
"version":"0.2.8",
"version":"0.3.0",
"description":"A lean and mean web router",

@@ -5,0 +5,0 @@ "contributors": [

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc