• 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
Re: Setting the NSURLDownload user agent
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting the NSURLDownload user agent


  • Subject: Re: Setting the NSURLDownload user agent
  • From: Nick Beadman <email@hidden>
  • Date: Tue, 21 Apr 2015 09:28:31 -0700

Thanks Jens and Quinn. I'll think about whether I should be providing my server with either and if so what.

On Tue, Apr 21, 2015 at 1:42 AM, Quinn "The Eskimo!" <email@hidden> wrote:

On 20 Apr 2015, at 19:37, Nick Beadman <email@hidden> wrote:

> Does any one have any idea how I would write code to get the CFNetwork and Darwin versions?

@import Foundation;

static NSString * CFNetworkVersion(void) {
    return [NSBundle bundleWithIdentifier:@"com.apple.CFNetwork"].infoDictionary[@"CFBundleShortVersionString"];
}

#include <sys/utsname.h>

static NSString * DarwinVersion(void) {
    struct utsname u;
    (void) uname(&u);
    return [NSString stringWithUTF8String:u.release];
}

However, I'm with Jens here: if you're going to set a customised user name, just use the OS name and version.  The only reason to be sending this goo is if you're server varies its behaviour base on the user agent string, which is a bad idea in general and pretty rare for a download server (as opposed to a server that's vending web pages, where it happens all the time).

Share and Enjoy
--
Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware



 _______________________________________________
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

 _______________________________________________
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

References: 
 >Setting the NSURLDownload user agent (From: Nick Beadman <email@hidden>)
 >Re: Setting the NSURLDownload user agent (From: "Quinn \"The Eskimo!\"" <email@hidden>)
 >Re: Setting the NSURLDownload user agent (From: Nick Beadman <email@hidden>)
 >Re: Setting the NSURLDownload user agent (From: "Quinn \"The Eskimo!\"" <email@hidden>)

  • Prev by Date: Re: Authentication isn't reentrant?
  • Next by Date: Re: Questions on when credentials are used in NSURLSessionDownloadTask
  • Previous by thread: Re: Setting the NSURLDownload user agent
  • Next by thread: Questions on when credentials are used in NSURLSessionDownloadTask
  • Index(es):
    • Date
    • Thread