Commit 39a044c9 authored by Wez's avatar Wez Committed by Commit Bot

[Fuchsia] Fix CastRunner decoding of app-Id from cast: URIs.

Previously we were incorrectly attempting to use the "host" portion of
the URI, rather than treating the whole "content" as the app-Id.

Bug: 893229
Change-Id: I5c95a828a28834449292b1cfec70a9974f3efef4
Reviewed-on: https://chromium-review.googlesource.com/c/1331169
Commit-Queue: Kevin Marshall <kmarshall@chromium.org>
Reviewed-by: default avatarKevin Marshall <kmarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607327}
parent c3867b23
......@@ -33,13 +33,13 @@ void CastRunner::StartComponent(
constexpr char kCastPresentationUrlScheme[] = "cast";
GURL cast_url(*package.resolved_url);
if (!cast_url.is_valid() || !cast_url.SchemeIs(kCastPresentationUrlScheme) ||
!cast_url.has_host()) {
cast_url.GetContent().empty()) {
LOG(ERROR) << "Rejected invalid URL: " << cast_url;
return;
}
constexpr char kTestCastAppId[] = "00000000";
base::StringPiece cast_app_id(cast_url.host_piece());
const std::string cast_app_id(cast_url.GetContent());
if (cast_app_id != kTestCastAppId) {
LOG(ERROR) << "Unknown Cast app Id: " << cast_app_id;
return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment