restify / restify/node-restify

ResourceNotFound with parameter length greater than 100

Open
#1,940 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
10.7k
Forks
975
Avg merge
1d 6h
Merged PRs (30d)
5

Description

Restify Version: 11.0.0
Node.js Version: 14.15.3

Expected behaviour

Routing should work irrespective of params length

Actual behaviour

Routing works for params length up to 100, gives ResourceNotFound error for any longer

Repro case

    let restify = require('restify');
    let server = restify.createServer();

    server.get('/test/:data', function(req, res, next) {
        res.end(`Length: ${req.params.data.length}`);
        return next();
    });

    server.listen(80);

Works:
http://localhost/test/1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890

Generates ResourceNotFound error.
http://localhost/test/12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901

Cause

It seems there's a limit of 100 for params, which changed I think from v6 --> v7
A config option to increase this limit will be very helpful.

Are you willing and able to fix this?

No, but I can help test.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the supplied Restify server and the two URLs in the repro case to confirm the 100-character boundary. Trace the routing and parameter handling that produces ResourceNotFound, then determine how the limit changed between the referenced versions. Done means routes accept parameter values longer than 100, with the requested limit configurable if that remains the chosen scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.