Skip to content

Instantly share code, notes, and snippets.

@metamatt
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save metamatt/e654f8ce7e25ed0fc906 to your computer and use it in GitHub Desktop.
Save metamatt/e654f8ce7e25ed0fc906 to your computer and use it in GitHub Desktop.
url.parse api changes between node 0.10 and node 0.12 break karma
See for example https://github.com/karma-runner/karma/blob/master/lib/middleware/karma.js#L40, which assumes the result of `url.parse(foo, true)` always has a non-null `.query` property.
In node 0.10.26:
magi@ubuntu ~/s/d/experiments> node-0.10.26
> url.parse('/foo', true)
{ protocol: null,
slashes: null,
auth: null,
host: null,
port: null,
hostname: null,
hash: null,
search: '',
query: {},
pathname: '/foo',
path: '/foo',
href: '/foo' }
In node 0.11.14-pre ("node 0.12"):
magi@ubuntu ~/s/d/experiments> node-0.12
> url.parse('/foo', true)
{ protocol: null,
slashes: null,
auth: null,
host: null,
port: null,
hostname: null,
hash: null,
search: null,
query: null,
pathname: '/foo',
path: '/foo',
href: '/foo' }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment