1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-22 15:54:57 +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,10 +175,14 @@ BlocklistDownloader* fBLDownloader = nil;
{ {
urlString = @""; urlString = @"";
} }
else if (![urlString isEqualToString:@""] && [urlString rangeOfString:@"://"].location == NSNotFound) else
{
urlString = [urlString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
if (![urlString isEqualToString:@""] && [urlString rangeOfString:@"://"].location == NSNotFound)
{ {
urlString = [@"https://" stringByAppendingString:urlString]; urlString = [@"https://" stringByAppendingString:urlString];
} }
}
NSURLSessionDownloadTask* task = [self.fSession downloadTaskWithURL:[NSURL URLWithString:urlString]]; NSURLSessionDownloadTask* task = [self.fSession downloadTaskWithURL:[NSURL URLWithString:urlString]];
[task resume]; [task resume];