From 39443c26e840aaa83f69539a09b4734341a3e5f3 Mon Sep 17 00:00:00 2001 From: Mehmet Fidanboylu Date: Sat, 11 Apr 2020 09:36:00 -0700 Subject: [PATCH] Ban HTTP by default on iOS and Android --- .../io/flutter/embedding/engine/loader/FlutterLoader.java | 2 ++ .../platform/darwin/ios/framework/Source/FlutterDartProject.mm | 3 +++ 2 files changed, 5 insertions(+) diff --git a/shell/platform/android/io/flutter/embedding/engine/loader/FlutterLoader.java b/shell/platform/android/io/flutter/embedding/engine/loader/FlutterLoader.java index 32fa212e8c647..e725785b51962 100644 --- a/shell/platform/android/io/flutter/embedding/engine/loader/FlutterLoader.java +++ b/shell/platform/android/io/flutter/embedding/engine/loader/FlutterLoader.java @@ -199,6 +199,8 @@ public void ensureInitializationComplete( if (settings.getLogTag() != null) { shellArgs.add("--log-tag=" + settings.getLogTag()); } + // On Android, we ban HTTP connections by default. + shellArgs.add("--disable-http"); String appStoragePath = PathUtils.getFilesDir(applicationContext); String engineCachesPath = PathUtils.getCacheDirectory(applicationContext); diff --git a/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm b/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm index 3e8bc4727b64b..d4c248ebb947d 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm @@ -132,6 +132,9 @@ } } + // On iOS, we ban HTTP by default. + settings.disable_http = true; + #if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG // There are no ownership concerns here as all mappings are owned by the // embedder and not the engine.