Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Fix issue with querystring on relative paths #8151

Closed
wants to merge 1 commit into from

Conversation

warseph
Copy link

@warseph warseph commented Aug 13, 2014

Fixes an issue that caused the first querystring to be parsed prepending a "?" in the first variable name on relative urls with no #fragment.

Example of the error: (Look the query property in the parsed url)

node git:(master) node -v
v0.10.26node git:(master) node
> require('url').parse('/profile?access_token=1', true);
{ protocol: null,
  slashes: null,
  auth: null,
  host: null,
  port: null,
  hostname: null,
  hash: null,
  search: '?access_token=1',
  query: { access_token: '1' },
  pathname: '/profile',
  path: '/profile?access_token=1',
  href: '/profile?access_token=1' }
node git:(master) ./node -v
v0.13.0-prenode git:(master) ./node
> require('url').parse('/profile?access_token=1', true);
{ protocol: null,
  slashes: null,
  auth: null,
  host: null,
  port: null,
  hostname: null,
  hash: null,
  search: '?access_token=1',
  query: { '?access_token': '1' },
  pathname: '/profile',
  path: '/profile?access_token=1',
  href: '/profile?access_token=1' }

Fixes an issue that caused the first querystring to be parsed
prepending a "?" in the first variable name on relative urls
with no #fragment
@trevnorris
Copy link

This is a fix, so should land on v0.12. Not master.

@trevnorris
Copy link

Thanks much. Landed in 678ead2.

@trevnorris trevnorris closed this Aug 13, 2014
@warseph
Copy link
Author

warseph commented Aug 13, 2014

Great :) Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants