1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-22 07:42:37 +00:00

macosx/BlocklistDownloader.mm: (#6096)

in (void)startDownload: now trimming whitespaces at the beginning and
end of the BlocklistURL, otherwise the download will fail, if the URL
contains a beginning or trailing whitespace.

Signed-off-by: Benedikt Bergenthal <benedikt@kdrennert.de>
Co-authored-by: Benedikt Bergenthal <benedikt@kdrennert.de>
This commit is contained in:
Benedikt Bergenthal 2023-10-24 17:45:45 +02:00 committed by GitHub
parent eb58996c9f
commit b5eaff114c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -175,9 +175,13 @@ BlocklistDownloader* fBLDownloader = nil;
{
urlString = @"";
}
else if (![urlString isEqualToString:@""] && [urlString rangeOfString:@"://"].location == NSNotFound)
else
{
urlString = [@"https://" stringByAppendingString:urlString];
urlString = [urlString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
if (![urlString isEqualToString:@""] && [urlString rangeOfString:@"://"].location == NSNotFound)
{
urlString = [@"https://" stringByAppendingString:urlString];
}
}
NSURLSessionDownloadTask* task = [self.fSession downloadTaskWithURL:[NSURL URLWithString:urlString]];