Fastify: Route not match on long unicode

Created on 25 Jun 2018  路  1Comment  路  Source: fastify/fastify

:+1:

Matched 
Url: /tag/丕卮鬲睾丕賱%20夭賳丕賳
Encoded version:
/tag/%D8%A7%D8%B4%D8%AA%D8%BA%D8%A7%D9%84%20%D8%B2%D9%86%D8%A7%D9%86

:cry:

404:
Url: 
/tag/賮乇丕讴爻蹖賵賳%20賲丨蹖胤%20夭蹖爻鬲
Encoded version:
/tag/%D9%81%D8%B1%D8%A7%DA%A9%D8%B3%DB%8C%D9%88%D9%86%20%D9%85%D8%AD%DB%8C%D8%B7%20%D8%B2%DB%8C%D8%B3%D8%AA

fastify.get('/tag/:tag', (request, reply) => {
 console.log(request.params);
});

When i use small tag it's matches seems be the problem is for long params.

What was the result you received?

404

What did you expect?

match the route and load the route method

Context

  • node version: v8.11.3
  • fastify version: ^1.6.0
  • os: Ubuntu, Docker Container
question

Most helpful comment

I guess you are working with a dynamic routes, so the declaration should be something like /tag/:tagId.
If so, Fastify has a configurable maximum length of the dynamic parameters, which is 100.
You can change it with maxParamLength :)

>All comments

I guess you are working with a dynamic routes, so the declaration should be something like /tag/:tagId.
If so, Fastify has a configurable maximum length of the dynamic parameters, which is 100.
You can change it with maxParamLength :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lean picture lean  路  3Comments

rqbazan picture rqbazan  路  3Comments

aaronshaf picture aaronshaf  路  3Comments

sebdeckers picture sebdeckers  路  4Comments

moltar picture moltar  路  3Comments