• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Problems with authenticated background downloads involving a 301 redirect
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Problems with authenticated background downloads involving a 301 redirect
      • From: "Quinn \"The Eskimo!\"" <email@hidden>
  • Prev by Date: Re: Implementing proxy support
  • Next by Date: Re: Implementing proxy support
  • Previous by thread: Re: Using NSURLSession for uploading lots of prioritized files
  • Next by thread: Re: Problems with authenticated background downloads involving a 301 redirect
  • Index(es):
    • Date
    • Thread