From 62df63de6cb27dba34c9e7a35712f67941cd4344 Mon Sep 17 00:00:00 2001 From: Aleksandar Lugonja Date: Mon, 24 Oct 2022 10:52:49 +0200 Subject: [PATCH 1/4] Exposed shared property HttpServer bind method to support more use-cases. --- lib/src/in_app_localhost_server.dart | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/src/in_app_localhost_server.dart b/lib/src/in_app_localhost_server.dart index 452ddbb1..4c1b8613 100755 --- a/lib/src/in_app_localhost_server.dart +++ b/lib/src/in_app_localhost_server.dart @@ -17,6 +17,7 @@ class InAppLocalhostServer { bool _started = false; HttpServer? _server; int _port = 8080; + bool _shared = false; String _directoryIndex = 'index.html'; String _documentRoot = './'; @@ -25,15 +26,24 @@ class InAppLocalhostServer { ///- [directoryIndex] represents the index file to use. The default value is `index.html`. /// ///- [documentRoot] represents the document root path to serve. The default value is `./`. + /// + ///- The optional argument [shared] specifies whether additional `HttpServer` + /// objects can bind to the same combination of `address`, `port` and `v6Only`. + /// If `shared` is `true` and more `HttpServer`s from this isolate or other + /// isolates are bound to the port, then the incoming connections will be + /// distributed among all the bound `HttpServer`s. Connections can be + /// distributed over multiple isolates this way. InAppLocalhostServer({ int port = 8080, String directoryIndex = 'index.html', String documentRoot = './', + bool shared = false, }) { this._port = port; this._directoryIndex = directoryIndex; this._documentRoot = (documentRoot.endsWith('/')) ? documentRoot : '$documentRoot/'; + this._shared = shared; } ///Starts the server on `http://localhost:[port]/`. @@ -57,7 +67,7 @@ class InAppLocalhostServer { var completer = Completer(); runZonedGuarded(() { - HttpServer.bind('127.0.0.1', _port).then((server) { + HttpServer.bind('127.0.0.1', _port, shared: _shared).then((server) { print('Server running on http://localhost:' + _port.toString()); this._server = server; From fcc415fc8ca74eceeec8392c1934647535dc3058 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 24 Oct 2022 10:38:59 +0000 Subject: [PATCH 2/4] update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 483972a2..a0017f89 100755 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ![InAppWebView-logo](https://user-images.githubusercontent.com/5956938/195422744-bdcfed16-73f0-4bc9-94ab-ecf10771a1c4.png) -[![All Contributors](https://img.shields.io/badge/all_contributors-65-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-66-orange.svg?style=flat-square)](#contributors-) [![Pub](https://img.shields.io/pub/v/flutter_inappwebview?include_prereleases)](https://pub.dartlang.org/packages/flutter_inappwebview) @@ -165,6 +165,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d perffecto
perffecto

💻 Chandra Abdul Fattah
Chandra Abdul Fattah

💻 + Aleksandar Lugonja
Aleksandar Lugonja

💻 From ccbfabe82c960757c7065831a13274589910116d Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 24 Oct 2022 10:39:00 +0000 Subject: [PATCH 3/4] update .all-contributorsrc --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 85bb8f79..3ed1cc7f 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -594,6 +594,15 @@ "contributions": [ "code" ] + }, + { + "login": "LugonjaAleksandar", + "name": "Aleksandar Lugonja", + "avatar_url": "https://avatars.githubusercontent.com/u/41632269?v=4", + "profile": "https://www.bebilica.rs/", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, From d5170c3dd8dcf169dad9e6f149d68f6630908c23 Mon Sep 17 00:00:00 2001 From: Lorenzo Pichilli Date: Mon, 24 Oct 2022 14:27:37 +0200 Subject: [PATCH 4/4] fix #1393 --- CHANGELOG.md | 9 +++++++++ ios/Classes/InAppWebView/InAppWebView.swift | 2 +- lib/src/in_app_webview/in_app_webview_settings.dart | 2 +- lib/src/in_app_webview/in_app_webview_settings.g.dart | 2 +- pubspec.yaml | 2 +- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fd74f9c..bc8628a7 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 6.0.0-beta.8 + +- Merged "Exposed "shared" property of HttpServer bind method to support more use-cases." [#1395](https://github.com/pichillilorenzo/flutter_inappwebview/pull/1395) (thanks to [LugonjaAleksandar](https://github.com/LugonjaAleksandar)) +- Fixed "ios 14.5 crash reports upgradeKnownHostsToHTTPS" [#1393](https://github.com/pichillilorenzo/flutter_inappwebview/issues/1393) + ## 6.0.0-beta.7 - Updated Android hybrid composition implementation @@ -71,6 +76,10 @@ - Removed `URLProtectionSpace.iosIsProxy` property - `historyUrl` and `baseUrl` of `InAppWebViewInitialData` can be `null` +## 5.7.1 + +- Exposed "shared" property of HttpServer bind method to support more use-cases. (thanks to [LugonjaAleksandar](https://github.com/LugonjaAleksandar)) + ## 5.7.0 - Added `PlatformViewsService.initExpensiveAndroidView` for Android diff --git a/ios/Classes/InAppWebView/InAppWebView.swift b/ios/Classes/InAppWebView/InAppWebView.swift index 427aa1ca..f1bccad3 100755 --- a/ios/Classes/InAppWebView/InAppWebView.swift +++ b/ios/Classes/InAppWebView/InAppWebView.swift @@ -594,7 +594,7 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, configuration.limitsNavigationsToAppBoundDomains = settings.limitsNavigationsToAppBoundDomains } - if #available(iOS 14.5, *) { + if #available(iOS 15.0, *) { configuration.upgradeKnownHostsToHTTPS = settings.upgradeKnownHostsToHTTPS } } diff --git a/lib/src/in_app_webview/in_app_webview_settings.dart b/lib/src/in_app_webview/in_app_webview_settings.dart index 8b109bc1..dd00d45a 100755 --- a/lib/src/in_app_webview/in_app_webview_settings.dart +++ b/lib/src/in_app_webview/in_app_webview_settings.dart @@ -1183,7 +1183,7 @@ class InAppWebViewSettings_ { ///A Boolean value indicating whether HTTP requests to servers known to support HTTPS should be automatically upgraded to HTTPS requests. ///The default value is `true`. /// - ///**NOTE for iOS**: available on iOS 14.5+. + ///**NOTE for iOS**: available on iOS 15.0+. /// ///**NOTE for MacOS**: available on MacOS 11.3+. /// diff --git a/lib/src/in_app_webview/in_app_webview_settings.g.dart b/lib/src/in_app_webview/in_app_webview_settings.g.dart index 4d046e0b..5169263c 100644 --- a/lib/src/in_app_webview/in_app_webview_settings.g.dart +++ b/lib/src/in_app_webview/in_app_webview_settings.g.dart @@ -1140,7 +1140,7 @@ class InAppWebViewSettings { ///A Boolean value indicating whether HTTP requests to servers known to support HTTPS should be automatically upgraded to HTTPS requests. ///The default value is `true`. /// - ///**NOTE for iOS**: available on iOS 14.5+. + ///**NOTE for iOS**: available on iOS 15.0+. /// ///**NOTE for MacOS**: available on MacOS 11.3+. /// diff --git a/pubspec.yaml b/pubspec.yaml index 89d154ff..08a9dcb9 100755 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_inappwebview description: A Flutter plugin that allows you to add an inline webview, to use an headless webview, and to open an in-app browser window. -version: 6.0.0-beta.7 +version: 6.0.0-beta.8 homepage: https://inappwebview.dev/ repository: https://github.com/pichillilorenzo/flutter_inappwebview issue_tracker: https://github.com/pichillilorenzo/flutter_inappwebview/issues