Skip to content

Commit

Permalink
v3.1.6
Browse files Browse the repository at this point in the history
- MimeType: fix charset for `text/html` type.

- sdk: '>=2.18.0 <4.0.0'
- intl: ^0.18.1
- resource_portable: ^3.1.0
  • Loading branch information
gmpassos committed Dec 30, 2023
1 parent 18eb893 commit b289df3
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 6 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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`:
Expand Down
2 changes: 1 addition & 1 deletion lib/src/collections.dart
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ bool isListOfListValuesAllEquals(Iterable<List>? 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);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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') ||
Expand Down
8 changes: 4 additions & 4 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 10 additions & 0 deletions test/swiss_knife_resource_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ class MyResourceLoader extends ResourceLoader {
Future<String> readAsString(Uri uri, {Encoding? encoding}) async {
return uri.toString().split('://')[1];
}

@override
Uri parseUri(String s) {
return Uri.parse(s);
}

@override
Future<Uri> resolveUri(Uri uri) async {
return uri;
}
}

void main() {
Expand Down

0 comments on commit b289df3

Please sign in to comment.