You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2021/07/29 08:50:57 UTC

[GitHub] [cordova-android] AdriVanHoudt commented on a change in pull request #1298: feat: support http w/ content src fix

AdriVanHoudt commented on a change in pull request #1298:
URL: https://github.com/apache/cordova-android/pull/1298#discussion_r678953783



##########
File path: framework/src/org/apache/cordova/ConfigXmlParser.java
##########
@@ -147,20 +149,40 @@ public void handleEndTag(XmlPullParser xml) {
         }
     }
 
+    private String getLaunchUrlPrefix() {
+        if (prefs.getBoolean("AndroidInsecureFileModeEnabled", false)) {
+            return "file:///android_asset/www/";
+        } else {
+            String scheme = prefs.getString("scheme", SCHEME_HTTPS).toLowerCase();
+            String hostname = prefs.getString("hostname", DEFAULT_HOSTNAME);
+
+            if (!scheme.contentEquals(SCHEME_HTTP) && !scheme.contentEquals(SCHEME_HTTPS)) {
+                LOG.d(TAG, "The provided scheme \"" + scheme + "\" is not valid. " +
+                    "Defaulting to \"" + SCHEME_HTTPS + "\". " +
+                    "(Valid Options=" + SCHEME_HTTP + "," + SCHEME_HTTPS + ")");
+
+                scheme = SCHEME_HTTPS;
+            }
+
+            return scheme + "://" + hostname + '/';
+        }
+    }
+
     private void setStartUrl(String src) {

Review comment:
       Just for someone not familiar with this code, I would rename this to `setLaunchUrl`.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org