Skip to content

Commit

Permalink
Fix missing trailing slash for path-less URLs (#1715)
Browse files Browse the repository at this point in the history
  • Loading branch information
Imran Remtulla committed Jul 15, 2024
1 parent d1cb268 commit 6a44fe2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/providers/source_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,10 @@ preStandardizeUrl(String url) {
url = 'https://$url';
}
var uri = Uri.tryParse(url);
var trailingSlash = (uri?.path.endsWith('/') ?? false) &&
var trailingSlash = ((uri?.path.endsWith('/') ?? false) ||
((uri?.path.isEmpty ?? false) && url.endsWith('/'))) &&
(uri?.queryParameters.isEmpty ?? false);

url = url
.split('/')
.where((e) => e.isNotEmpty)
Expand Down

0 comments on commit 6a44fe2

Please sign in to comment.