fix(router): handle empty path with query params

This commit is contained in:
vsavkin
2016-06-25 12:07:47 -07:00
parent 90295e3252
commit 3f44377f2f
2 changed files with 12 additions and 1 deletions

View File

@ -277,7 +277,11 @@ class UrlParser {
}
parseRootSegment(): UrlSegment {
if (this.remaining === '' || this.remaining === '/') {
if (this.remaining.startsWith('/')) {
this.capture('/');
}
if (this.remaining === '' || this.remaining.startsWith('?')) {
return new UrlSegment([], {});
} else {
return new UrlSegment([], this.parseSegmentChildren());