Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(602)

Unified Diff: sky/apk/demo/org/domokit/sky/demo/SkyDemoActivity.java

Issue 958203002: Don't crash when we 404. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Works! Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sky/engine/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/apk/demo/org/domokit/sky/demo/SkyDemoActivity.java
diff --git a/sky/apk/demo/org/domokit/sky/demo/SkyDemoActivity.java b/sky/apk/demo/org/domokit/sky/demo/SkyDemoActivity.java
index 7d9021c04abf983bc23dfbda29cc4de7d860bed6..9288d5ace05ca1a3b63c0c4fa5067741e33c7bee 100644
--- a/sky/apk/demo/org/domokit/sky/demo/SkyDemoActivity.java
+++ b/sky/apk/demo/org/domokit/sky/demo/SkyDemoActivity.java
@@ -26,6 +26,12 @@ public class SkyDemoActivity extends SkyActivity {
if (Intent.ACTION_VIEW.equals(intent.getAction())) {
Uri skyUri = intent.getData();
Uri httpsUri = skyUri.buildUpon().scheme("https").build();
+ // This is a hack to disable https for local testing.
+ // getHost may be null if we're passed a non-normalized url.
+ if (skyUri.getHost() != null
+ && skyUri.getHost().equals("localhost")) {
+ httpsUri = skyUri.buildUpon().scheme("http").build();
+ }
url = httpsUri.toString();
}
« no previous file with comments | « no previous file | sky/engine/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698