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

find-my-way

Package Overview
Dependencies
Maintainers
2
Versions
112
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

find-my-way - npm Package Compare versions

Comparing version 1.9.1 to 1.10.0

test/max-param-length.test.js

5

index.js

@@ -38,2 +38,3 @@ 'use strict'

this.ignoreTrailingSlash = opts.ignoreTrailingSlash || false
this.maxParamLength = opts.maxParamLength || 100
this.tree = new Node()

@@ -268,2 +269,3 @@ this.routes = []

Router.prototype.find = function find (method, path) {
var maxParamLength = this.maxParamLength
var currentNode = this.tree

@@ -353,2 +355,3 @@ var wildcardNode = null

while (i < pathLen && path.charCodeAt(i) !== 47) i++
if (i > maxParamLength) return null
decoded = fastDecode(path.slice(0, i))

@@ -380,2 +383,3 @@ if (errored) {

while (i < pathLen && path.charCodeAt(i) !== 47) i++
if (i > maxParamLength) return null
decoded = fastDecode(path.slice(0, i))

@@ -401,2 +405,3 @@ if (errored) {

while (i < pathLen && path.charCodeAt(i) !== 47 && path.charCodeAt(i) !== 45) i++
if (i > maxParamLength) return null
}

@@ -403,0 +408,0 @@ decoded = fastDecode(path.slice(0, i))

2

package.json
{
"name": "find-my-way",
"version": "1.9.1",
"version": "1.10.0",
"description": "Crazy fast http radix based router",

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

@@ -63,2 +63,9 @@ # find-my-way

You can set a custom length for parameters in parametric *(standard, regex and multi)* routes by using `maxParamLength` option, the default value is 100 characters.<br/>
*If the maximum length limit is reached, the default route will be invoked.*
```js
const router = require('find-my-way')({
maxParamLength: 500
})
```
<a name="on"></a>

@@ -65,0 +72,0 @@ #### on(method, path, handler, [store])

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