GoogleChromeLabs / native-url

Node's url module implemented using the built-in URL API.
https://npm.im/native-url
Apache License 2.0
284 stars 11 forks source link

pathname parsing issue with colon + double digit numbers #27

Closed Janpot closed 4 years ago

Janpot commented 4 years ago

This is breaking next.js https://github.com/vercel/next.js/issues/14419

Expected Behavior

require('native-url').parse('/:42').pathname
// '/:42'
require('native-url').parse('/hello:42world').pathname
// '/hello:42world'

Actual Behavior

require('native-url').parse('/:42').pathname
// '/:4200'
require('native-url').parse('/hello:42world').pathname
// '/hello:4200world'

Steps to Reproduce the Problem

  1. run the snippets presented above

Specifications

Janpot commented 4 years ago

looks like it's caused by https://github.com/GoogleChromeLabs/native-url/blob/6b0a92a0db0caafe6400d54533df04703cb2cf65/src/parse.js#L91