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

bug: Incorrectly decodes % #13

Closed Timer closed 4 years ago

Timer commented 4 years ago

Expected Behavior

> url.parse('?percent=%25')
Url {
  protocol: null,
  slashes: null,
  auth: null,
  host: null,
  port: null,
  hostname: null,
  hash: null,
  search: '?percent=%25',
  query: 'percent=%25',
  pathname: null,
  path: '?percent=%25',
  href: '?percent=%25'
}

Actual Behavior

> require('native-url').parse('?percent=%25')
{
  slashes: null,
  host: null,
  hostname: null,
  protocol: null,
  search: '?percent=%',
  hash: null,
  query: 'percent=%',
  pathname: null,
  path: '?percent=%',
  auth: null,
  port: null,
  href: '?percent=%'
}

Steps to Reproduce the Problem

N/A

Specifications

Timer commented 4 years ago

Fixed by #16