Merge pull request #829 from jiahan5/patch-1
fix(llc): avoid invalid url
This commit is contained in:
@@ -25,6 +25,10 @@
|
|||||||
|
|
||||||
- [[#846]](https://github.com/GetStream/stream-chat-flutter/issues/846) Fixed `message.ownReactions` getting truncated when receiving a reaction event.
|
- [[#846]](https://github.com/GetStream/stream-chat-flutter/issues/846) Fixed `message.ownReactions` getting truncated when receiving a reaction event.
|
||||||
|
|
||||||
|
🐞 Fixed
|
||||||
|
|
||||||
|
- Add check for invalid image URLs
|
||||||
|
|
||||||
## 3.3.1
|
## 3.3.1
|
||||||
|
|
||||||
🐞 Fixed
|
🐞 Fixed
|
||||||
|
|||||||
@@ -1532,16 +1532,21 @@ class ChannelClientState {
|
|||||||
if (url == null || !url.contains('')) {
|
if (url == null || !url.contains('')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final uri = Uri.parse(url);
|
try {
|
||||||
if (!uri.host.endsWith('stream-io-cdn.com') ||
|
final uri = Uri.parse(url);
|
||||||
uri.queryParameters['Expires'] == null) {
|
if (!uri.host.endsWith('stream-io-cdn.com') ||
|
||||||
|
uri.queryParameters['Expires'] == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
final secondsFromEpoch =
|
||||||
|
int.parse(uri.queryParameters['Expires']!);
|
||||||
|
final expiration = DateTime.fromMillisecondsSinceEpoch(
|
||||||
|
secondsFromEpoch * 1000,
|
||||||
|
);
|
||||||
|
return expiration.isBefore(DateTime.now());
|
||||||
|
} catch (_) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final secondsFromEpoch =
|
|
||||||
int.parse(uri.queryParameters['Expires']!);
|
|
||||||
final expiration =
|
|
||||||
DateTime.fromMillisecondsSinceEpoch(secondsFromEpoch * 1000);
|
|
||||||
return expiration.isBefore(DateTime.now());
|
|
||||||
}))
|
}))
|
||||||
.map((e) => e.id)
|
.map((e) => e.id)
|
||||||
.toList();
|
.toList();
|
||||||
|
|||||||
Reference in New Issue
Block a user