mirror of
https://github.com/iptv-org/iptv
synced 2026-11-30 13:04:49 -05:00
fix: keep %25 escapes when playlist:format normalizes links
decodeURI decodes %25, so normalizeURL turned an encoded percent sign into a bare "%": in the path (normalize-url runs decodeURI on the pathname) a%2520b became a%20b, a different file, and in the query token=50%25off became token=50%off, a malformed escape. %25 is now swapped for a placeholder before normalize-url and put back after decoding.
This commit is contained in:
3 files changed
+13
-1
No files matched your search
@@ -70,6 +70,9 @@ describe('playlist:format', () => {
|
||||
expect(output).toContain(
|
||||
'http://example.com/index.m3u8?name=TV%2B&url=http%3A%2F%2Fexample.org%2Fa.m3u8%3Fk%3D1%26exp%3D2'
|
||||
)
|
||||
expect(output).toContain('http://example.com/a%2520b/index.m3u8')
|
||||
expect(output).toContain('http://example.com/index.m3u8?token=50%25off')
|
||||
expect(output).toContain('http://example.com/a%ZZ/index.m3u8?token=50%25off')
|
||||
})
|
||||
|
||||
it('removes a duplicate that was the only stream in its file', () => {
|
||||
|
||||
Reference in new issue
Block a user