diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ea1357..d1fee88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## 3.1.6 + +- MimeType: fix charset for `text/html` type. + +- sdk: '>=2.18.0 <4.0.0' +- intl: ^0.18.1 +- resource_portable: ^3.1.0 + ## 3.1.5 - `MimeType`: diff --git a/lib/src/collections.dart b/lib/src/collections.dart index a4268c7..f8be8a9 100644 --- a/lib/src/collections.dart +++ b/lib/src/collections.dart @@ -909,7 +909,7 @@ bool isListOfListValuesAllEquals(Iterable? list, : list.firstWhere((e) => e.isNotEmpty).first; if (eqValueIndex != null) { - return listMatchesAll(list, (v) => v is List && v[eqValueIndex] == eqValue); + return listMatchesAll(list, (v) => v[eqValueIndex] == eqValue); } else { return listMatchesAll(list, (v) => v == eqValue); } diff --git a/lib/src/data.dart b/lib/src/data.dart index 7d43a88..4001b92 100644 --- a/lib/src/data.dart +++ b/lib/src/data.dart @@ -171,7 +171,7 @@ class MimeType { mimeType == 'htm' || mimeType.endsWith('/html') || mimeType.endsWith('/htm')) { - return MimeType('text', 'html'); + return MimeType('text', 'html', charset); } else if (mimeType == 'icon' || mimeType == 'ico' || mimeType.endsWith('/x-icon') || diff --git a/pubspec.yaml b/pubspec.yaml index 4c738ac..5aac54c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,14 +1,14 @@ name: swiss_knife description: Dart Useful Tools - collections, math, date, uri, json, events, resources, regexp, etc... -version: 3.1.5 +version: 3.1.6 homepage: https://github.com/gmpassos/swiss_knife environment: - sdk: '>=2.12.0 <3.0.0' + sdk: '>=2.18.0 <4.0.0' dependencies: - intl: ^0.18.0 - resource_portable: ^3.0.1 + intl: ^0.18.1 + resource_portable: ^3.1.0 dev_dependencies: lints: ^2.0.1 diff --git a/test/swiss_knife_resource_test.dart b/test/swiss_knife_resource_test.dart index 1cf2111..20d9c6f 100644 --- a/test/swiss_knife_resource_test.dart +++ b/test/swiss_knife_resource_test.dart @@ -20,6 +20,16 @@ class MyResourceLoader extends ResourceLoader { Future readAsString(Uri uri, {Encoding? encoding}) async { return uri.toString().split('://')[1]; } + + @override + Uri parseUri(String s) { + return Uri.parse(s); + } + + @override + Future resolveUri(Uri uri) async { + return uri; + } } void main() {