-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove matrix parameters from URL to prevent accumulation (#976)
Co-authored-by: max.kless@googlemail.com <max.kless@googlemail.com>
- Loading branch information
Showing
12 changed files
with
66 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { TestBed } from '@angular/core/testing'; | ||
import { UrlSerializer } from '@angular/router'; | ||
|
||
import { PWAUrlSerializer } from './pwa-url.serializer'; | ||
|
||
describe('Pwa Url Serializer', () => { | ||
let urlSerializer: UrlSerializer; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({ providers: [{ provide: UrlSerializer, useClass: PWAUrlSerializer }] }); | ||
urlSerializer = TestBed.inject(UrlSerializer); | ||
}); | ||
|
||
it('should deal with parenthesis in parameter names', () => { | ||
const tree = urlSerializer.parse('/path/a/b/c?param=(value)'); | ||
const result = urlSerializer.serialize(tree); | ||
expect(result).toMatchInlineSnapshot(`"/path/a/b/c?param=(value)"`); | ||
}); | ||
|
||
it('should deal with parenthesis in path segment names', () => { | ||
const tree = urlSerializer.parse('/path/a/(segmentname)'); | ||
const result = urlSerializer.serialize(tree); | ||
expect(result).toMatchInlineSnapshot(`"/path/a/(segmentname)"`); | ||
}); | ||
|
||
it('should remove matrix parameters from URL', () => { | ||
const tree = urlSerializer.parse('/path/a/b/c;matrix=value'); | ||
const result = urlSerializer.serialize(tree); | ||
expect(result).toMatchInlineSnapshot(`"/path/a/b/c"`); | ||
}); | ||
|
||
it('should remove matrix parameters from and keep query params in URL', () => { | ||
const tree = urlSerializer.parse('/path/a/b/c;matrix=value?test=dummy&foo=bar'); | ||
const result = urlSerializer.serialize(tree); | ||
expect(result).toMatchInlineSnapshot(`"/path/a/b/c?test=dummy&foo=bar"`); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters