Commit Graph

16 Commits

Author SHA1 Message Date
Marc-Antoine 14821c30fb fix: Correctly extract file extension from URLs with dots in query params (#9946)
### Description

Fixes #9945 

The `getExtension` function (rewritten for performance in #9816) scans
the URI right-to-left, encountering dots in query parameter values (e.g.
hostnames like `app.example.com`, filenames like `en.vtt`) before
finding the `?` delimiter. This causes incorrect extension detection,
breaking MIME type resolution for URLs with signed parameters or other
query strings containing dots.

**Fix:** Split the single right-to-left scan into two passes:
1. **Left-to-right:** find the first `?` or `#` to establish the path
boundary
2. **Right-to-left:** scan backward within the path portion only,
looking for `.` or `/`

This preserves the lightweight character-scanning approach from #9816
without reintroducing the `goog.Uri` dependency.

**New test cases added:**
- Dots in query parameter values
(`?host=app.example.com&signature=abc.def`)
- Signed URLs with encoded paths and filenames in query strings
- Hostname-like values in query parameters (`?origin=cdn.example.co.uk`)
- No path extension with dotted query values (`/stream?file=video.mp4` →
`""`)
- Dots in fragment identifiers (`#t=1.5`)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 12:11:03 -07:00
Álvaro Velad Galván e7b6d10b58 perf(net): Optimize getExtension URI parsing (#9816)
Co-authored-by: Wojciech Tyczyński <tykus160@gmail.com>
2026-03-11 14:29:05 +01:00
Álvaro Velad Galván fd5dac0798 feat(UI): Add support for chapter images in MediaSession (#9761)
Co-authored-by: Theodore Abshire <TheodoreAbshire@Gmail.com>
2026-02-26 10:54:08 +01:00
Álvaro Velad Galván c920ecd4fa chore: Move createSegmentRequest to shaka.net.NetworkingUtils (#9363) 2025-11-05 21:05:49 +01:00
Álvaro Velad Galván 4bc2518e29 feat!: Remove LRC, SBV, SSA support (#9330)
Related to https://github.com/shaka-project/shaka-player/issues/9321
2025-11-04 20:07:02 +01:00
Álvaro Velad Galván e85b648ef0 feat!: Remove MSS support (#9329)
Related to https://github.com/shaka-project/shaka-player/issues/9321
2025-11-04 20:06:44 +01:00
Álvaro Velad Galván 180c2e7e40 chore: Use the same getExtension function in all code (#9081) 2025-09-11 13:47:59 +02:00
Álvaro Velad Galván e971a68f35 chore: Stop using "Object" in networking annotations (#7937)
Related to #1672
2025-01-24 10:54:58 +01:00
Wojciech Tyczyński 6e55a3b21b build: Forbid using dot in generic types (#7904)
Fixes #2643

Happy reviewing!
2025-01-20 09:39:51 +01:00
Álvaro Velad Galván b0be77998a fix: Detect mov extension as video/quicktime (#7884) 2025-01-13 20:27:24 +01:00
Álvaro Velad Galván 87cbf4d90a fix(Ads): Don't try to play Image and HTML overlay interstitials (#7697)
We don't currently support those types of interstitials, so this PR makes the player properly reject them.
2024-11-29 17:01:54 -08:00
Álvaro Velad Galván 6716ff00c4 fix: Avoid make HEAD request for image mime type (#7332) 2024-09-17 20:55:16 +02:00
Rodolphe Breton b45877d17b fix: Improved HEAD request fail test when fallback-ing to GET request (#6044) 2024-01-08 15:23:35 +01:00
Álvaro Velad Galván 1af93e63ff fix: Provide a fallback to GET request when HEAD request fails (#5986)
Fixes https://github.com/shaka-project/shaka-player/issues/5959
2023-12-05 08:19:25 +01:00
Álvaro Velad Galván c2c8320251 fix(Offline): Fix download of some HLS manifests (#5861) 2023-11-06 20:38:49 +01:00
Álvaro Velad Galván be96fd0a2b feat(net): Add shaka.net.NetworkingUtils (#5756) 2023-10-09 23:08:08 -07:00