Fixes an issue that caused the first querystring to be parsed prepending
a "?" in the first variable name on relative urls with no #fragment
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
if (simplePath[2]) {
this.search = simplePath[2];
if (parseQueryString) {
- this.query = querystring.parse(this.search);
+ this.query = querystring.parse(this.search.substr(1));
} else {
this.query = this.search.substr(1);
}
'search': '',
'pathname': '/',
'path': '/'
+ },
+ '/example?query=value':{
+ protocol: null,
+ slashes: null,
+ auth: null,
+ host: null,
+ port: null,
+ hostname: null,
+ hash: null,
+ search: '?query=value',
+ query: { query: 'value' },
+ pathname: '/example',
+ path: '/example?query=value',
+ href: '/example?query=value'
}
};
for (var u in parseTestsWithQueryString) {