Re: How should a NSURLProtocol handle a wrong URL?
Re: How should a NSURLProtocol handle a wrong URL?
- Subject: Re: How should a NSURLProtocol handle a wrong URL?
- From: "Quinn \"The Eskimo!\"" <email@hidden>
- Date: Fri, 01 Aug 2014 12:37:57 +0100
On 1 Aug 2014, at 11:58, Daryle Walker <email@hidden> wrote:
> Iām talking about the protocol being passed a wrong scheme, getting a URL with/without an authority (ā//ā and a host) but you handle only the other way, misspelled string, etc.
It depends on what your goal is. Why did you implement the protocol in the first place? For example, if you're implementing a custom protocol to support HTTP Live Streaming [1], it'd probably be best to return NO from +canInitWithRequest:. That way NSURL{Session,Connection} will simply act like it would if the protocol wasn't installed. OTOH, if you're overriding HTTPS to implement custom HTTPS server trust evaluation, you don't necessary want the request to fall through to the standard HTTPS implementation, in which case it'd be best to accept the request and then fail it.
Share and Enjoy
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
[1] As described in WWDC 2010 Session 403 "Advances in HTTP Live Streaming".
_______________________________________________
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