fix(UrlParser) stop setting default value 'true' (matrix params) (#10946)

This was already fixed recently for query params in #10399.
This commit is contained in:
James Blacklock 2016-08-26 18:41:32 -04:00 committed by Victor Berchet
parent 27539c8b80
commit 4a44832114
2 changed files with 3 additions and 3 deletions

View File

@ -391,7 +391,7 @@ class UrlParser {
return;
}
this.capture(key);
let value: any = 'true';
let value: any = '';
if (this.peekStartsWith('=')) {
this.capture('=');
const valueMatch = matchSegments(this.remaining);

View File

@ -113,9 +113,9 @@ describe('url serializer', () => {
it('should parse key only matrix params', () => {
const tree = url.parse('/one;a');
expectSegment(tree.root.children[PRIMARY_OUTLET], 'one;a=true');
expectSegment(tree.root.children[PRIMARY_OUTLET], 'one;a=');
expect(url.serialize(tree)).toEqual('/one;a=true');
expect(url.serialize(tree)).toEqual('/one;a=');
});
it('should parse query params (root)', () => {