From 7872a209027ec6f6d5fe3fc0c201fd2d3f68772a Mon Sep 17 00:00:00 2001 From: Alex Li Date: Thu, 2 Nov 2023 15:00:02 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20Removes=20the=20assertion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/cookie_manager/lib/src/cookie_mgr.dart | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/plugins/cookie_manager/lib/src/cookie_mgr.dart b/plugins/cookie_manager/lib/src/cookie_mgr.dart index 9004ed5d3..3ada643b4 100644 --- a/plugins/cookie_manager/lib/src/cookie_mgr.dart +++ b/plugins/cookie_manager/lib/src/cookie_mgr.dart @@ -4,10 +4,6 @@ import 'dart:io'; import 'package:cookie_jar/cookie_jar.dart'; import 'package:dio/dio.dart'; -const _kIsWeb = bool.hasEnvironment('dart.library.js_util') - ? bool.fromEnvironment('dart.library.js_util') - : identical(0, 0.0); - /// - `(?<=)` is a positive lookbehind assertion that matches a comma (",") /// only if it's preceded by a specific pattern. In this case, the lookbehind /// assertion is empty, which means it matches any comma that's preceded by any character. @@ -21,9 +17,7 @@ final _setCookieReg = RegExp('(?<=)(,)(?=[^;]+?=)'); /// Cookie manager for HTTP requests based on [CookieJar]. class CookieManager extends Interceptor { - const CookieManager( - this.cookieJar, - ) : assert(!_kIsWeb, "Don't use the manager in Web environments."); + const CookieManager(this.cookieJar); final CookieJar cookieJar;