Problems with authenticated background downloads involving a 301 redirect
Problems with authenticated background downloads involving a 301 redirect
- Subject: Problems with authenticated background downloads involving a 301 redirect
- From: Scott Hancher <email@hidden>
- Date: Fri, 18 Jul 2014 16:23:40 -0700
I'm downloading files from our servers using an https scheme and an OAuth 2 'Authorization' header. The server receiving the request redirects via a 301 to a different URL for the actual file to download.
The download works without issue if it's performed in the foreground (NSURLSession created with an NSURLSessionConfiguration created via [NSURLSessionConfiguration ephemeralSessionConfiguration]).
However, if a background download is attempted (using [NSURLSessionConfiguration backgroundSessionConfiguration:] to construct the NSURLSessionConfiguration), then the download fails via a 403 status code.
The exact same URL with 'Authorization' header works without issue through curl from a Mac.
Any idea why? There doesn't appear to be any difference in the code path for these two cases except in how the NSURLSessionConfiguration is constructed.
++Scott.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden