Skip to content

Commit

Permalink
Merge pull request onevcat#22 from onevcat/feature/challenge
Browse files Browse the repository at this point in the history
Rename property names
  • Loading branch information
onevcat committed Apr 21, 2015
2 parents 97db633 + 5d53161 commit 1295514
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Kingfisher/ImageDownloader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class ImageDownloader: NSObject {
public var downloadTimeout: NSTimeInterval = 15.0

/// A set of trusted hosts when receiving server trust challenges. A challenge with host name contained in this set will be ignored. You can use this set to specify the self-signed site.
public var trustHosts: Set<String>?
public var trustedHosts: Set<String>?

// MARK: - Internal property
let barrierQueue = dispatch_queue_create(downloaderBarrierName, DISPATCH_QUEUE_CONCURRENT)
Expand Down Expand Up @@ -218,7 +218,7 @@ extension ImageDownloader: NSURLSessionDataDelegate {
public func URLSession(session: NSURLSession, didReceiveChallenge challenge: NSURLAuthenticationChallenge, completionHandler: (NSURLSessionAuthChallengeDisposition, NSURLCredential!) -> Void) {

if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust {
if let trustHosts = trustHosts where trustHosts.contains(challenge.protectionSpace.host) {
if let trustedHosts = trustedHosts where trustedHosts.contains(challenge.protectionSpace.host) {
let credential = NSURLCredential(forTrust: challenge.protectionSpace.serverTrust)
completionHandler(.UseCredential, credential)
return
Expand Down

0 comments on commit 1295514

Please sign in to comment.