From 0ee9de78cfbcdb276950788590599cc001e1f469 Mon Sep 17 00:00:00 2001 From: Lorenzo Pichilli Date: Mon, 7 Sep 2020 16:33:21 +0200 Subject: [PATCH] fix #476 --- CHANGELOG.md | 1 + .../pichillilorenzo/flutter_inappwebview/MyCookieManager.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f075913..d074ac9f 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - Fixed "Issue in Flutter web: 'Unsupported operation: Platform._operatingSystem'" [#507](https://github.com/pichillilorenzo/flutter_inappwebview/issues/507) - Fixed "window.flutter_inappwebview.callHandler is not a function" [#218](https://github.com/pichillilorenzo/flutter_inappwebview/issues/218) - Fixed "Android ContentBlocker - java.lang.NullPointerException ContentBlockerTrigger resource type" [#506](https://github.com/pichillilorenzo/flutter_inappwebview/issues/506) +- Fixed "Android CookieManager throws error caused by websites that are sending back illegal/invalid cookies." [#476](https://github.com/pichillilorenzo/flutter_inappwebview/issues/476) ## 4.0.0+4 diff --git a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/MyCookieManager.java b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/MyCookieManager.java index dea21f16..1156d8db 100755 --- a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/MyCookieManager.java +++ b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/MyCookieManager.java @@ -153,7 +153,7 @@ public class MyCookieManager implements MethodChannel.MethodCallHandler { for (String cookie : cookies) { String[] nameValue = cookie.split("=", 2); String name = nameValue[0].trim(); - String value = nameValue[1].trim(); + String value = (nameValue.length > 1) ? nameValue[1].trim() : ""; Map cookieMap = new HashMap<>(); cookieMap.put("name", name); cookieMap.put("value", value);