Commit b2996bd3 authored by David Van Cleve's avatar David Van Cleve Committed by Commit Bot

Make the android-app:// scheme hierarchical

This CL marks (on Android) the android-app scheme as hierarchical
("standard") in order for them to not get butchered by "truncate to
origin" referrer policies, such as the new default policy (currently
in the process of rolling out; crbug.com/1014207) of
strict-origin-when-cross-origin.

URLs of the android-app scheme are of the form
android-app://my.package.name/some/more/information; because they're not
"standard" (GURL) / "hierarchical" (KURL), when you take their origin
you get an opaque origin; because they're cross-origin with everything
else, a policy of "truncate to origin on cross-origin requests" (which
is the new default) ends up zeroing these referrers out, which might
not be what we want.

Marking the scheme as standard means that you can meaningfully take
the origin (usually yielding the package name), which gives the behavior
we want.

Bug: 1046384
Change-Id: Ib5b80b197964ba2f0623699c0e33e945c20a0ba2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2024691Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarPeter Conn <peconn@chromium.org>
Commit-Queue: David Van Cleve <davidvc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#737337}
parent 06429d8b
...@@ -67,7 +67,7 @@ public class TabsOpenedFromExternalAppTest { ...@@ -67,7 +67,7 @@ public class TabsOpenedFromExternalAppTest {
private static final String EXTERNAL_APP_1_ID = "app1"; private static final String EXTERNAL_APP_1_ID = "app1";
private static final String EXTERNAL_APP_2_ID = "app2"; private static final String EXTERNAL_APP_2_ID = "app2";
private static final String ANDROID_APP_REFERRER = "android-app://com.my.great.great.app"; private static final String ANDROID_APP_REFERRER = "android-app://com.my.great.great.app/";
private static final String HTTPS_REFERRER = "https://chromium.org/"; private static final String HTTPS_REFERRER = "https://chromium.org/";
private static final String HTTPS_REFERRER_WITH_PATH = "https://chromium.org/path1/path2"; private static final String HTTPS_REFERRER_WITH_PATH = "https://chromium.org/path1/path2";
......
...@@ -706,10 +706,11 @@ void ChromeContentClient::AddContentDecryptionModules( ...@@ -706,10 +706,11 @@ void ChromeContentClient::AddContentDecryptionModules(
// Example standard schemes: https://, chrome-extension://, chrome://, file:// // Example standard schemes: https://, chrome-extension://, chrome://, file://
// Example nonstandard schemes: mailto:, data:, javascript:, about: // Example nonstandard schemes: mailto:, data:, javascript:, about:
static const char* const kChromeStandardURLSchemes[] = { static const char* const kChromeStandardURLSchemes[] = {
extensions::kExtensionScheme, extensions::kExtensionScheme, chrome::kChromeNativeScheme,
chrome::kChromeNativeScheme, chrome::kChromeSearchScheme, dom_distiller::kDomDistillerScheme,
chrome::kChromeSearchScheme, #if defined(OS_ANDROID)
dom_distiller::kDomDistillerScheme, chrome::kAndroidAppScheme,
#endif
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
chrome::kCrosScheme, chrome::kCrosScheme,
#endif #endif
......
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