When trying to download update get error in log "Too many HTML Redirects" #265

Open
ghost opened this Issue Apr 7, 2013 · 1 comment

Comments

Projects
None yet
0 participants
@ghost

ghost commented Apr 7, 2013

013-04-07 00:16:12 +0000: Sparkle Error: An error occurred while downloading the update. Please try again later.
2013-04-07 00:16:12 +0000: Sparkle Error (continued): too many HTTP redirects

If I type the URL it is trying to use it downloads the file. It does download the for the appcast.xml and the release notes HTML without errors.

@ghost

ghost commented Apr 7, 2013

I found the solution. I believe that a file was left in the local or remote cache. Once I changed the code below it works perfectly now. It was failing 100% of the time before.

  • (void)downloadUpdate
    {
    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[updateItem fileURL]];
    [request setValue:[updater userAgentString] forHTTPHeaderField:@"User-Agent"];
    [request setTimeoutInterval:60];

    [request setCachePolicy:NSURLRequestReloadIgnoringCacheData];

    download = [[NSURLDownload alloc] initWithRequest:request delegate:self];
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment