} else if (declared_uri_value != resource_uri.spec()) {(1) I don't understand how this ensures the url is path-only; a comment would be helpful.
(2) I think this will be brittle, but we can't use SecurityOrigin since it's in blink. Is there someway this code could query up to the WebMediaPlayer instance?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
} else if (declared_uri_value != resource_uri.spec()) {(1) I don't understand how this ensures the url is path-only; a comment would be helpful.
(2) I think this will be brittle, but we can't use SecurityOrigin since it's in blink. Is there someway this code could query up to the WebMediaPlayer instance?
for (1), yeah I'll add a comment. for (2), we specifically do not want to compare to the security origin for this, but rather to the origin of the manifest. The manifest itself might be CORS for the page. there's more of a writeup for why in the linked bug.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
GURL uri,Can we rename this to playlist_uri?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
if (!resource_uri.is_valid()) {What is considered invalid? It seems like "https://example.com/manifest.m3u8".Resolve("https://anotherexample.com/file.key") would generate an invalid URI. Ditto with data://. Are the lines below even reachable post-Resolve? I assume so since you have a test which passes, but I don't really understand Resolve() then.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +2 |
if (!resource_uri.is_valid()) {What is considered invalid? It seems like "https://example.com/manifest.m3u8".Resolve("https://anotherexample.com/file.key") would generate an invalid URI. Ditto with data://. Are the lines below even reachable post-Resolve? I assume so since you have a test which passes, but I don't really understand Resolve() then.
`uri.Resolve(str path)` basically treats `path` as a GURL with potentially missing parts, and then fills those parts in from `uri`. In your example, the "str path" url isn't missing any parts, so it gets returned as a fully formed GURL. Some other examples:
- `"https://example.com/xyz/manifest.txt".resolve("secret.key") => "https://example.com/xyz/secret.key"` (added scheme, origin, and dirname(path))
- `"wss://example.com".resolve("//google.com/socket") => "wss://google.com/socket"` (added scheme)
- `"http://example.com/long/directory/path.txt".resolve("/secret.key") => "http://example.com/secret.key"` (added scheme and origin)
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
if (!resource_uri.is_valid()) {Ted (Chromium) MeyerWhat is considered invalid? It seems like "https://example.com/manifest.m3u8".Resolve("https://anotherexample.com/file.key") would generate an invalid URI. Ditto with data://. Are the lines below even reachable post-Resolve? I assume so since you have a test which passes, but I don't really understand Resolve() then.
`uri.Resolve(str path)` basically treats `path` as a GURL with potentially missing parts, and then fills those parts in from `uri`. In your example, the "str path" url isn't missing any parts, so it gets returned as a fully formed GURL. Some other examples:
- `"https://example.com/xyz/manifest.txt".resolve("secret.key") => "https://example.com/xyz/secret.key"` (added scheme, origin, and dirname(path))
- `"wss://example.com".resolve("//google.com/socket") => "wss://google.com/socket"` (added scheme)
- `"http://example.com/long/directory/path.txt".resolve("/secret.key") => "http://example.com/secret.key"` (added scheme and origin)
Oh, forgot the "invalid" part. Basically its for if either the GURL on which `::Resolve` is called is itself not valid, or if the first arg is empty, or some other non-URL friendly characters, that kind of thing. It's here so that we catch stuff like people setting the key url to `:\\://:\\://:\\://:` or something equally insane.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Restrict origins for HLS keys
HLS encrypted content should not be able to use a key which was loaded
from a source that is "insecure". A key-source is considered secure when
it meets one of these requirements:
- it is not a cross-origin key (hosted on the same domain as the frame
in which it is being accessed)
- it is a data:// url (fully embedded in the manifest)
- it is on the same domain as the manifest from which it is loaded.
- it has the proper Access-Control-Allow-Origin header for the top
frame in which the media is being played.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |