Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Commit

Permalink
🐛 Fix some URLs (e.g. https://bandcamp.com) not getting previewed
Browse files Browse the repository at this point in the history
  • Loading branch information
Komposten committed Oct 19, 2019
1 parent 456a8da commit 28499bf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/services/link_preview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ class LinkPreviewService {
}));

if (matches.length > 0) {
String urlMimeType = _utilsService.geFileNameMimeType(matches.first);
Uri url = Uri.parse(matches.first);
String urlMimeType = _utilsService.geFileNameMimeType(url.path);
if (urlMimeType != null) {
String urlFirstType = urlMimeType.split('/').first;
if (urlFirstType != 'image' && urlFirstType != 'text') return null;
Expand Down

0 comments on commit 28499bf

Please sign in to comment.