Compare commits

...
Author SHA1 Message Date
Zorg 4eaedee9ab Add custom timeout setting for testing unreliable connection 2024-12-06 22:48:22 -08:00
+12 -1
View File
@@ -112,7 +112,18 @@
_delegate = delegate;
_inBackground = background;
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:requestURL cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:30.0];
NSProcessInfo *processInfo = [NSProcessInfo processInfo];
NSString *customTimeout = processInfo.environment[@"SPARKLE_TIMEOUT"];
NSTimeInterval timeout;
if (customTimeout != nil) {
timeout = customTimeout.doubleValue;
} else {
timeout = 60.0;
}
NSLog(@"SPARKLE_TIMEOUT: %f", timeout);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:requestURL cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:timeout];
if (userAgent != nil) {
[request setValue:(NSString * _Nonnull)userAgent forHTTPHeaderField:@"User-Agent"];