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

restify

Package Overview
Dependencies
Maintainers
0
Versions
184
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

restify - npm Package Compare versions

Comparing version 0.1.21 to 0.1.22

26

lib/http_extra.js

@@ -209,6 +209,12 @@ // Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.

handlers: _handlers,
urlComponents: url.split('/').slice(1),
version: version
version: version,
regexRoute: false
};
if (url instanceof RegExp) {
r.regexRoute = true;
} else {
r.urlComponents = url.split('/').slice(1);
}
this.routes[version][method].push(r);

@@ -228,3 +234,5 @@ this.routes.urls[version][url].push(r);

if (!args[0] || typeof(args[0]) !== 'string')
if (!args[0] || (typeof(args[0]) !== 'string' &&
!(args[0] instanceof RegExp)))
throw new TypeError('argument 0 must be a string (version or url)');

@@ -253,3 +261,4 @@

if (!args[0] || typeof(args[0]) !== 'string')
if (!args[0] || (typeof(args[0]) !== 'string' &&
!(args[0] instanceof RegExp)))
throw new TypeError('argument 0 must be a string (version or url)');

@@ -278,3 +287,4 @@

if (!args[0] || typeof(args[0]) !== 'string')
if (!args[0] || (typeof(args[0]) !== 'string' &&
!(args[0] instanceof RegExp)))
throw new TypeError('argument 0 must be a string (version or url)');

@@ -303,3 +313,4 @@

if (!args[0] || typeof(args[0]) !== 'string')
if (!args[0] || (typeof(args[0]) !== 'string' &&
!(args[0] instanceof RegExp)))
throw new TypeError('argument 0 must be a string (version or url)');

@@ -328,3 +339,4 @@

if (!args[0] || typeof(args[0]) !== 'string')
if (!args[0] || (typeof(args[0]) !== 'string' &&
!(args[0] instanceof RegExp)))
throw new TypeError('argument 0 must be a string (version or url)');

@@ -331,0 +343,0 @@

@@ -64,4 +64,8 @@ // Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.

if (path === route.url) return {}; // there were no params in this case...
if (path === route.url)
return {}; // there were no params in this case...
if (route.regexRoute)
return route.url.exec(path);
var params = route.urlComponents;

@@ -68,0 +72,0 @@ var components = path.split('/').splice(1);

{
"name": "restify",
"description": "REST framework specifically meant for web service APIs",
"version": "0.1.21",
"version": "0.1.22",
"repository": {

@@ -6,0 +6,0 @@ "type": "git",

@@ -194,1 +194,21 @@ // Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.

};
exports.test_regex_route = function(test, assert) {
var server = restify.createServer();
var socket = '/tmp/.' + uuid();
server.get(/^\/users?(?:\/(\d+)(?:\.\.(\d+))?)?/, _handler);
server.listen(socket, function() {
var opts = common.newOptions(socket, '/users/1..15');
http.request(opts, function(res) {
common.checkResponse(assert, res);
assert.equal(res.statusCode, 200);
server.on('close', function() {
test.finish();
});
server.close();
}).end();
});
};
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