浏览代码

Updating copyright year

Mattt Thompson 10 年之前
父节点
当前提交
011dc783e9
共有 51 个文件被更改,包括 396 次插入396 次删除
  1. 1 1
      AFNetworking/AFHTTPRequestOperation.m
  2. 10 10
      AFNetworking/AFHTTPRequestOperationManager.h
  3. 3 3
      AFNetworking/AFHTTPRequestOperationManager.m
  4. 1 1
      AFNetworking/AFHTTPSessionManager.h
  5. 2 2
      AFNetworking/AFHTTPSessionManager.m
  6. 10 10
      AFNetworking/AFNetworkReachabilityManager.h
  7. 7 7
      AFNetworking/AFNetworkReachabilityManager.m
  8. 9 9
      AFNetworking/AFSecurityPolicy.h
  9. 3 3
      AFNetworking/AFSecurityPolicy.m
  10. 11 11
      AFNetworking/AFURLConnectionOperation.h
  11. 29 29
      AFNetworking/AFURLConnectionOperation.m
  12. 13 13
      AFNetworking/AFURLRequestSerialization.h
  13. 10 10
      AFNetworking/AFURLRequestSerialization.m
  14. 4 4
      AFNetworking/AFURLResponseSerialization.h
  15. 7 7
      AFNetworking/AFURLResponseSerialization.m
  16. 1 1
      AFNetworking/AFURLSessionManager.h
  17. 12 12
      AFNetworking/AFURLSessionManager.m
  18. 1 1
      Tests/Tests/1.0 Tests/AFHTTPClientTests.m
  19. 15 15
      Tests/Tests/1.0 Tests/AFHTTPRequestOperationTests.m
  20. 1 1
      Tests/Tests/1.0 Tests/AFImageRequestOperationTests.m
  21. 1 1
      Tests/Tests/1.0 Tests/AFJSONRequestOperationTests.m
  22. 1 1
      Tests/Tests/1.0 Tests/AFMockURLProtocol.h
  23. 1 1
      Tests/Tests/1.0 Tests/AFMockURLProtocol.m
  24. 1 1
      Tests/Tests/1.0 Tests/AFNetworkingTests.h
  25. 1 1
      Tests/Tests/1.0 Tests/AFNetworkingTests.m
  26. 75 75
      Tests/Tests/1.0 Tests/AFURLConnectionOperationTests.m
  27. 54 54
      Tests/Tests/AFHTTPRequestOperationTests.m
  28. 6 6
      Tests/Tests/AFHTTPRequestSerializationTests.m
  29. 1 1
      Tests/Tests/AFHTTPResponseSerializationTests.m
  30. 3 3
      Tests/Tests/AFHTTPSessionManagerTests.m
  31. 2 2
      Tests/Tests/AFJSONSerializationTests.m
  32. 5 5
      Tests/Tests/AFNetworkActivityManagerTests.m
  33. 1 1
      Tests/Tests/AFPropertyListResponseSerializerTests.m
  34. 35 35
      Tests/Tests/AFSecurityPolicyTests.m
  35. 1 1
      Tests/Tests/AFTestCase.h
  36. 1 1
      Tests/Tests/AFTestCase.m
  37. 13 13
      Tests/Tests/AFURLSessionManagerTests.m
  38. 1 1
      UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h
  39. 4 4
      UIKit+AFNetworking/AFNetworkActivityIndicatorManager.m
  40. 2 2
      UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h
  41. 1 1
      UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m
  42. 3 3
      UIKit+AFNetworking/UIAlertView+AFNetworking.h
  43. 1 1
      UIKit+AFNetworking/UIAlertView+AFNetworking.m
  44. 9 9
      UIKit+AFNetworking/UIButton+AFNetworking.h
  45. 1 1
      UIKit+AFNetworking/UIButton+AFNetworking.m
  46. 13 13
      UIKit+AFNetworking/UIImageView+AFNetworking.h
  47. 2 2
      UIKit+AFNetworking/UIImageView+AFNetworking.m
  48. 2 2
      UIKit+AFNetworking/UIProgressView+AFNetworking.h
  49. 1 1
      UIKit+AFNetworking/UIProgressView+AFNetworking.m
  50. 3 3
      UIKit+AFNetworking/UIWebView+AFNetworking.h
  51. 1 1
      UIKit+AFNetworking/UIWebView+AFNetworking.m

+ 1 - 1
AFNetworking/AFHTTPRequestOperation.m

@@ -1,6 +1,6 @@
 // AFHTTPRequestOperation.m
 // AFHTTPRequestOperation.m
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal

+ 10 - 10
AFNetworking/AFHTTPRequestOperationManager.h

@@ -1,6 +1,6 @@
 // AFHTTPRequestOperationManager.h
 // AFHTTPRequestOperationManager.h
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal
@@ -40,19 +40,19 @@
  `AFHTTPRequestOperationManager` encapsulates the common patterns of communicating with a web application over HTTP, including request creation, response serialization, network reachability monitoring, and security, as well as request operation management.
  `AFHTTPRequestOperationManager` encapsulates the common patterns of communicating with a web application over HTTP, including request creation, response serialization, network reachability monitoring, and security, as well as request operation management.
 
 
  ## Subclassing Notes
  ## Subclassing Notes
- 
+
  Developers targeting iOS 7 or Mac OS X 10.9 or later that deal extensively with a web service are encouraged to subclass `AFHTTPSessionManager`, providing a class method that returns a shared singleton object on which authentication and other configuration can be shared across the application.
  Developers targeting iOS 7 or Mac OS X 10.9 or later that deal extensively with a web service are encouraged to subclass `AFHTTPSessionManager`, providing a class method that returns a shared singleton object on which authentication and other configuration can be shared across the application.
- 
+
  For developers targeting iOS 6 or Mac OS X 10.8 or earlier, `AFHTTPRequestOperationManager` may be used to similar effect.
  For developers targeting iOS 6 or Mac OS X 10.8 or earlier, `AFHTTPRequestOperationManager` may be used to similar effect.
- 
+
  ## Methods to Override
  ## Methods to Override
 
 
  To change the behavior of all request operation construction for an `AFHTTPRequestOperationManager` subclass, override `HTTPRequestOperationWithRequest:success:failure`.
  To change the behavior of all request operation construction for an `AFHTTPRequestOperationManager` subclass, override `HTTPRequestOperationWithRequest:success:failure`.
 
 
  ## Serialization
  ## Serialization
- 
- Requests created by an HTTP client will contain default headers and encode parameters according to the `requestSerializer` property, which is an object conforming to `<AFURLRequestSerialization>`. 
- 
+
+ Requests created by an HTTP client will contain default headers and encode parameters according to the `requestSerializer` property, which is an object conforming to `<AFURLRequestSerialization>`.
+
  Responses received from the server are automatically validated and serialized by the `responseSerializers` property, which is an object conforming to `<AFURLResponseSerialization>`
  Responses received from the server are automatically validated and serialized by the `responseSerializers` property, which is an object conforming to `<AFURLResponseSerialization>`
 
 
  ## URL Construction Using Relative Paths
  ## URL Construction Using Relative Paths
@@ -91,7 +91,7 @@
 
 
 /**
 /**
  Requests created with `requestWithMethod:URLString:parameters:` & `multipartFormRequestWithMethod:URLString:parameters:constructingBodyWithBlock:` are constructed with a set of default headers using a parameter serialization specified by this property. By default, this is set to an instance of `AFHTTPRequestSerializer`, which serializes query string parameters for `GET`, `HEAD`, and `DELETE` requests, or otherwise URL-form-encodes HTTP message bodies.
  Requests created with `requestWithMethod:URLString:parameters:` & `multipartFormRequestWithMethod:URLString:parameters:constructingBodyWithBlock:` are constructed with a set of default headers using a parameter serialization specified by this property. By default, this is set to an instance of `AFHTTPRequestSerializer`, which serializes query string parameters for `GET`, `HEAD`, and `DELETE` requests, or otherwise URL-form-encodes HTTP message bodies.
- 
+
  @warning `requestSerializer` must not be `nil`.
  @warning `requestSerializer` must not be `nil`.
  */
  */
 @property (nonatomic, strong) AFHTTPRequestSerializer <AFURLRequestSerialization> * requestSerializer;
 @property (nonatomic, strong) AFHTTPRequestSerializer <AFURLRequestSerialization> * requestSerializer;
@@ -169,9 +169,9 @@
 
 
 /**
 /**
  Initializes an `AFHTTPRequestOperationManager` object with the specified base URL.
  Initializes an `AFHTTPRequestOperationManager` object with the specified base URL.
- 
+
  This is the designated initializer.
  This is the designated initializer.
- 
+
  @param url The base URL for the HTTP client.
  @param url The base URL for the HTTP client.
 
 
  @return The newly-initialized HTTP client
  @return The newly-initialized HTTP client

+ 3 - 3
AFNetworking/AFHTTPRequestOperationManager.m

@@ -1,6 +1,6 @@
 // AFHTTPRequestOperationManager.m
 // AFHTTPRequestOperationManager.m
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal
@@ -43,7 +43,7 @@
 }
 }
 
 
 - (instancetype)init {
 - (instancetype)init {
-    return [self initWithBaseURL:nil];    
+    return [self initWithBaseURL:nil];
 }
 }
 
 
 - (instancetype)initWithBaseURL:(NSURL *)url {
 - (instancetype)initWithBaseURL:(NSURL *)url {
@@ -278,7 +278,7 @@
 
 
     HTTPClient.requestSerializer = [self.requestSerializer copyWithZone:zone];
     HTTPClient.requestSerializer = [self.requestSerializer copyWithZone:zone];
     HTTPClient.responseSerializer = [self.responseSerializer copyWithZone:zone];
     HTTPClient.responseSerializer = [self.responseSerializer copyWithZone:zone];
-    
+
     return HTTPClient;
     return HTTPClient;
 }
 }
 
 

+ 1 - 1
AFNetworking/AFHTTPSessionManager.h

@@ -1,6 +1,6 @@
 // AFHTTPSessionManager.h
 // AFHTTPSessionManager.h
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal

+ 2 - 2
AFNetworking/AFHTTPSessionManager.m

@@ -1,6 +1,6 @@
 // AFHTTPSessionManager.m
 // AFHTTPSessionManager.m
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal
@@ -312,7 +312,7 @@
 
 
     HTTPClient.requestSerializer = [self.requestSerializer copyWithZone:zone];
     HTTPClient.requestSerializer = [self.requestSerializer copyWithZone:zone];
     HTTPClient.responseSerializer = [self.responseSerializer copyWithZone:zone];
     HTTPClient.responseSerializer = [self.responseSerializer copyWithZone:zone];
-    
+
     return HTTPClient;
     return HTTPClient;
 }
 }
 
 

+ 10 - 10
AFNetworking/AFNetworkReachabilityManager.h

@@ -1,6 +1,6 @@
 // AFNetworkReachabilityManager.h
 // AFNetworkReachabilityManager.h
-// 
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal
@@ -8,10 +8,10 @@
 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 // copies of the Software, and to permit persons to whom the Software is
 // copies of the Software, and to permit persons to whom the Software is
 // furnished to do so, subject to the following conditions:
 // furnished to do so, subject to the following conditions:
-// 
+//
 // The above copyright notice and this permission notice shall be included in
 // The above copyright notice and this permission notice shall be included in
 // all copies or substantial portions of the Software.
 // all copies or substantial portions of the Software.
-// 
+//
 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -32,11 +32,11 @@ typedef NS_ENUM(NSInteger, AFNetworkReachabilityStatus) {
 
 
 /**
 /**
  `AFNetworkReachabilityManager` monitors the reachability of domains, and addresses for both WWAN and WiFi network interfaces.
  `AFNetworkReachabilityManager` monitors the reachability of domains, and addresses for both WWAN and WiFi network interfaces.
- 
+
  Reachability can be used to determine background information about why a network operation failed, or to trigger a network operation retrying when a connection is established. It should not be used to prevent a user from initiating a network request, as it's possible that an initial request may be required to establish reachability.
  Reachability can be used to determine background information about why a network operation failed, or to trigger a network operation retrying when a connection is established. It should not be used to prevent a user from initiating a network request, as it's possible that an initial request may be required to establish reachability.
 
 
  See Apple's Reachability Sample Code (https://developer.apple.com/library/ios/samplecode/reachability/)
  See Apple's Reachability Sample Code (https://developer.apple.com/library/ios/samplecode/reachability/)
- 
+
  @warning Instances of `AFNetworkReachabilityManager` must be started with `-startMonitoring` before reachability status can be determined.
  @warning Instances of `AFNetworkReachabilityManager` must be started with `-startMonitoring` before reachability status can be determined.
  */
  */
 @interface AFNetworkReachabilityManager : NSObject
 @interface AFNetworkReachabilityManager : NSObject
@@ -72,9 +72,9 @@ typedef NS_ENUM(NSInteger, AFNetworkReachabilityStatus) {
 
 
 /**
 /**
  Creates and returns a network reachability manager for the specified domain.
  Creates and returns a network reachability manager for the specified domain.
- 
+
  @param domain The domain used to evaluate network reachability.
  @param domain The domain used to evaluate network reachability.
- 
+
  @return An initialized network reachability manager, actively monitoring the specified domain.
  @return An initialized network reachability manager, actively monitoring the specified domain.
  */
  */
 + (instancetype)managerForDomain:(NSString *)domain;
 + (instancetype)managerForDomain:(NSString *)domain;
@@ -90,9 +90,9 @@ typedef NS_ENUM(NSInteger, AFNetworkReachabilityStatus) {
 
 
 /**
 /**
  Initializes an instance of a network reachability manager from the specified reachability object.
  Initializes an instance of a network reachability manager from the specified reachability object.
- 
+
  @param reachability The reachability object to monitor.
  @param reachability The reachability object to monitor.
- 
+
  @return An initialized network reachability manager, actively monitoring the specified reachability.
  @return An initialized network reachability manager, actively monitoring the specified reachability.
  */
  */
 - (instancetype)initWithReachability:(SCNetworkReachabilityRef)reachability NS_DESIGNATED_INITIALIZER;
 - (instancetype)initWithReachability:(SCNetworkReachabilityRef)reachability NS_DESIGNATED_INITIALIZER;

+ 7 - 7
AFNetworking/AFNetworkReachabilityManager.m

@@ -1,6 +1,6 @@
 // AFNetworkReachabilityManager.m
 // AFNetworkReachabilityManager.m
-// 
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal
@@ -8,10 +8,10 @@
 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 // copies of the Software, and to permit persons to whom the Software is
 // copies of the Software, and to permit persons to whom the Software is
 // furnished to do so, subject to the following conditions:
 // furnished to do so, subject to the following conditions:
-// 
+//
 // The above copyright notice and this permission notice shall be included in
 // The above copyright notice and this permission notice shall be included in
 // all copies or substantial portions of the Software.
 // all copies or substantial portions of the Software.
-// 
+//
 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -88,7 +88,7 @@ static void AFNetworkReachabilityCallback(SCNetworkReachabilityRef __unused targ
         NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
         NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
         [notificationCenter postNotificationName:AFNetworkingReachabilityDidChangeNotification object:nil userInfo:@{ AFNetworkingReachabilityNotificationStatusItem: @(status) }];
         [notificationCenter postNotificationName:AFNetworkingReachabilityDidChangeNotification object:nil userInfo:@{ AFNetworkingReachabilityNotificationStatusItem: @(status) }];
     });
     });
-    
+
 }
 }
 
 
 static const void * AFNetworkReachabilityRetainCallback(const void *info) {
 static const void * AFNetworkReachabilityRetainCallback(const void *info) {
@@ -214,11 +214,11 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
                 AFNetworkReachabilityStatus status = AFNetworkReachabilityStatusForFlags(flags);
                 AFNetworkReachabilityStatus status = AFNetworkReachabilityStatusForFlags(flags);
                 dispatch_async(dispatch_get_main_queue(), ^{
                 dispatch_async(dispatch_get_main_queue(), ^{
                     callback(status);
                     callback(status);
-                    
+
                     NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
                     NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
                     [notificationCenter postNotificationName:AFNetworkingReachabilityDidChangeNotification object:nil userInfo:@{ AFNetworkingReachabilityNotificationStatusItem: @(status) }];
                     [notificationCenter postNotificationName:AFNetworkingReachabilityDidChangeNotification object:nil userInfo:@{ AFNetworkingReachabilityNotificationStatusItem: @(status) }];
 
 
-                    
+
                 });
                 });
             });
             });
         }
         }

+ 9 - 9
AFNetworking/AFSecurityPolicy.h

@@ -1,6 +1,6 @@
 // AFSecurityPolicy.h
 // AFSecurityPolicy.h
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal
@@ -31,7 +31,7 @@ typedef NS_ENUM(NSUInteger, AFSSLPinningMode) {
 
 
 /**
 /**
  `AFSecurityPolicy` evaluates server trust against pinned X.509 certificates and public keys over secure connections.
  `AFSecurityPolicy` evaluates server trust against pinned X.509 certificates and public keys over secure connections.
- 
+
  Adding pinned SSL certificates to your app helps prevent man-in-the-middle attacks and other vulnerabilities. Applications dealing with sensitive customer data or financial information are strongly encouraged to route all communication over an HTTPS connection with SSL pinning configured and enabled.
  Adding pinned SSL certificates to your app helps prevent man-in-the-middle attacks and other vulnerabilities. Applications dealing with sensitive customer data or financial information are strongly encouraged to route all communication over an HTTPS connection with SSL pinning configured and enabled.
  */
  */
 @interface AFSecurityPolicy : NSObject
 @interface AFSecurityPolicy : NSObject
@@ -67,7 +67,7 @@ typedef NS_ENUM(NSUInteger, AFSSLPinningMode) {
 
 
 /**
 /**
  Returns the shared default security policy, which does not allow invalid certificates, does not validate domain name, and does not validate against pinned certificates or public keys.
  Returns the shared default security policy, which does not allow invalid certificates, does not validate domain name, and does not validate against pinned certificates or public keys.
- 
+
  @return The default security policy.
  @return The default security policy.
  */
  */
 + (instancetype)defaultPolicy;
 + (instancetype)defaultPolicy;
@@ -80,7 +80,7 @@ typedef NS_ENUM(NSUInteger, AFSSLPinningMode) {
  Creates and returns a security policy with the specified pinning mode.
  Creates and returns a security policy with the specified pinning mode.
 
 
  @param pinningMode The SSL pinning mode.
  @param pinningMode The SSL pinning mode.
- 
+
  @return A new security policy.
  @return A new security policy.
  */
  */
 + (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode;
 + (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode;
@@ -97,19 +97,19 @@ typedef NS_ENUM(NSUInteger, AFSSLPinningMode) {
  @param serverTrust The X.509 certificate trust of the server.
  @param serverTrust The X.509 certificate trust of the server.
 
 
  @return Whether or not to trust the server.
  @return Whether or not to trust the server.
- 
+
  @warning This method has been deprecated in favor of `-evaluateServerTrust:forDomain:`.
  @warning This method has been deprecated in favor of `-evaluateServerTrust:forDomain:`.
  */
  */
 - (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust DEPRECATED_ATTRIBUTE;
 - (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust DEPRECATED_ATTRIBUTE;
 
 
 /**
 /**
- Whether or not the specified server trust should be accepted, based on the security policy. 
- 
+ Whether or not the specified server trust should be accepted, based on the security policy.
+
  This method should be used when responding to an authentication challenge from a server.
  This method should be used when responding to an authentication challenge from a server.
- 
+
  @param serverTrust The X.509 certificate trust of the server.
  @param serverTrust The X.509 certificate trust of the server.
  @param domain The domain of serverTrust. If `nil`, the domain will not be validated.
  @param domain The domain of serverTrust. If `nil`, the domain will not be validated.
- 
+
  @return Whether or not to trust the server.
  @return Whether or not to trust the server.
  */
  */
 - (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust
 - (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust

+ 3 - 3
AFNetworking/AFSecurityPolicy.m

@@ -1,6 +1,6 @@
 // AFSecurityPolicy.m
 // AFSecurityPolicy.m
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal
@@ -125,7 +125,7 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) {
 
 
         SecTrustRef trust;
         SecTrustRef trust;
         __Require_noErr_Quiet(SecTrustCreateWithCertificates(certificates, policy, &trust), _out);
         __Require_noErr_Quiet(SecTrustCreateWithCertificates(certificates, policy, &trust), _out);
-        
+
         SecTrustResultType result;
         SecTrustResultType result;
         __Require_noErr_Quiet(SecTrustEvaluate(trust, &result), _out);
         __Require_noErr_Quiet(SecTrustEvaluate(trust, &result), _out);
 
 
@@ -304,7 +304,7 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) {
             return trustedPublicKeyCount > 0 && ((self.validatesCertificateChain && trustedPublicKeyCount == [serverCertificates count]) || (!self.validatesCertificateChain && trustedPublicKeyCount >= 1));
             return trustedPublicKeyCount > 0 && ((self.validatesCertificateChain && trustedPublicKeyCount == [serverCertificates count]) || (!self.validatesCertificateChain && trustedPublicKeyCount >= 1));
         }
         }
     }
     }
-    
+
     return NO;
     return NO;
 }
 }
 
 

+ 11 - 11
AFNetworking/AFURLConnectionOperation.h

@@ -1,6 +1,6 @@
 // AFURLConnectionOperation.h
 // AFURLConnectionOperation.h
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal
@@ -47,7 +47,7 @@
  - `connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:`
  - `connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:`
  - `connection:willCacheResponse:`
  - `connection:willCacheResponse:`
  - `connectionShouldUseCredentialStorage:`
  - `connectionShouldUseCredentialStorage:`
- - `connection:needNewBodyStream:` 
+ - `connection:needNewBodyStream:`
  - `connection:willSendRequestForAuthenticationChallenge:`
  - `connection:willSendRequestForAuthenticationChallenge:`
 
 
  If any of these methods are overridden in a subclass, they _must_ call the `super` implementation first.
  If any of these methods are overridden in a subclass, they _must_ call the `super` implementation first.
@@ -57,17 +57,17 @@
  The built-in `completionBlock` provided by `NSOperation` allows for custom behavior to be executed after the request finishes. It is a common pattern for class constructors in subclasses to take callback block parameters, and execute them conditionally in the body of its `completionBlock`. Make sure to handle cancelled operations appropriately when setting a `completionBlock` (i.e. returning early before parsing response data). See the implementation of any of the `AFHTTPRequestOperation` subclasses for an example of this.
  The built-in `completionBlock` provided by `NSOperation` allows for custom behavior to be executed after the request finishes. It is a common pattern for class constructors in subclasses to take callback block parameters, and execute them conditionally in the body of its `completionBlock`. Make sure to handle cancelled operations appropriately when setting a `completionBlock` (i.e. returning early before parsing response data). See the implementation of any of the `AFHTTPRequestOperation` subclasses for an example of this.
 
 
  Subclasses are strongly discouraged from overriding `setCompletionBlock:`, as `AFURLConnectionOperation`'s implementation includes a workaround to mitigate retain cycles, and what Apple rather ominously refers to as ["The Deallocation Problem"](http://developer.apple.com/library/ios/#technotes/tn2109/).
  Subclasses are strongly discouraged from overriding `setCompletionBlock:`, as `AFURLConnectionOperation`'s implementation includes a workaround to mitigate retain cycles, and what Apple rather ominously refers to as ["The Deallocation Problem"](http://developer.apple.com/library/ios/#technotes/tn2109/).
- 
+
  ## SSL Pinning
  ## SSL Pinning
- 
+
  Relying on the CA trust model to validate SSL certificates exposes your app to security vulnerabilities, such as man-in-the-middle attacks. For applications that connect to known servers, SSL certificate pinning provides an increased level of security, by checking server certificate validity against those specified in the app bundle.
  Relying on the CA trust model to validate SSL certificates exposes your app to security vulnerabilities, such as man-in-the-middle attacks. For applications that connect to known servers, SSL certificate pinning provides an increased level of security, by checking server certificate validity against those specified in the app bundle.
- 
+
  SSL with certificate pinning is strongly recommended for any application that transmits sensitive information to an external webservice.
  SSL with certificate pinning is strongly recommended for any application that transmits sensitive information to an external webservice.
 
 
  Connections will be validated on all matching certificates with a `.cer` extension in the bundle root.
  Connections will be validated on all matching certificates with a `.cer` extension in the bundle root.
- 
+
  ## App Extensions
  ## App Extensions
- 
+
  When using AFNetworking in an App Extension, `#define AF_APP_EXTENSIONS` to avoid using unavailable APIs.
  When using AFNetworking in an App Extension, `#define AF_APP_EXTENSIONS` to avoid using unavailable APIs.
 
 
  ## NSCoding & NSCopying Conformance
  ## NSCoding & NSCopying Conformance
@@ -211,9 +211,9 @@
 
 
 /**
 /**
  Initializes and returns a newly allocated operation object with a url connection configured with the specified url request.
  Initializes and returns a newly allocated operation object with a url connection configured with the specified url request.
- 
+
  This is the designated initializer.
  This is the designated initializer.
- 
+
  @param urlRequest The request object to be used by the operation connection.
  @param urlRequest The request object to be used by the operation connection.
  */
  */
 - (instancetype)initWithRequest:(NSURLRequest *)urlRequest NS_DESIGNATED_INITIALIZER;
 - (instancetype)initWithRequest:(NSURLRequest *)urlRequest NS_DESIGNATED_INITIALIZER;
@@ -280,9 +280,9 @@
 
 
 /**
 /**
  Sets a block to be executed when the connection will authenticate a challenge in order to download its request, as handled by the `NSURLConnectionDelegate` method `connection:willSendRequestForAuthenticationChallenge:`.
  Sets a block to be executed when the connection will authenticate a challenge in order to download its request, as handled by the `NSURLConnectionDelegate` method `connection:willSendRequestForAuthenticationChallenge:`.
- 
+
  @param block A block object to be executed when the connection will authenticate a challenge in order to download its request. The block has no return type and takes two arguments: the URL connection object, and the challenge that must be authenticated. This block must invoke one of the challenge-responder methods (NSURLAuthenticationChallengeSender protocol).
  @param block A block object to be executed when the connection will authenticate a challenge in order to download its request. The block has no return type and takes two arguments: the URL connection object, and the challenge that must be authenticated. This block must invoke one of the challenge-responder methods (NSURLAuthenticationChallengeSender protocol).
- 
+
  If `allowsInvalidSSLCertificate` is set to YES, `connection:willSendRequestForAuthenticationChallenge:` will attempt to have the challenge sender use credentials with invalid SSL certificates.
  If `allowsInvalidSSLCertificate` is set to YES, `connection:willSendRequestForAuthenticationChallenge:` will attempt to have the challenge sender use credentials with invalid SSL certificates.
  */
  */
 - (void)setWillSendRequestForAuthenticationChallengeBlock:(void (^)(NSURLConnection *connection, NSURLAuthenticationChallenge *challenge))block;
 - (void)setWillSendRequestForAuthenticationChallengeBlock:(void (^)(NSURLConnection *connection, NSURLAuthenticationChallenge *challenge))block;

+ 29 - 29
AFNetworking/AFURLConnectionOperation.m

@@ -1,6 +1,6 @@
 // AFURLConnectionOperation.m
 // AFURLConnectionOperation.m
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal
@@ -177,7 +177,7 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
         _networkRequestThread = [[NSThread alloc] initWithTarget:self selector:@selector(networkRequestThreadEntryPoint:) object:nil];
         _networkRequestThread = [[NSThread alloc] initWithTarget:self selector:@selector(networkRequestThreadEntryPoint:) object:nil];
         [_networkRequestThread start];
         [_networkRequestThread start];
     });
     });
-    
+
     return _networkRequestThread;
     return _networkRequestThread;
 }
 }
 
 
@@ -193,11 +193,11 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
 
 
     self.lock = [[NSRecursiveLock alloc] init];
     self.lock = [[NSRecursiveLock alloc] init];
     self.lock.name = kAFNetworkingLockName;
     self.lock.name = kAFNetworkingLockName;
-    
+
     self.runLoopModes = [NSSet setWithObject:NSRunLoopCommonModes];
     self.runLoopModes = [NSSet setWithObject:NSRunLoopCommonModes];
-    
+
     self.request = urlRequest;
     self.request = urlRequest;
-    
+
     self.shouldUseCredentialStorage = YES;
     self.shouldUseCredentialStorage = YES;
 
 
     self.securityPolicy = [AFSecurityPolicy defaultPolicy];
     self.securityPolicy = [AFSecurityPolicy defaultPolicy];
@@ -210,7 +210,7 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
         [_outputStream close];
         [_outputStream close];
         _outputStream = nil;
         _outputStream = nil;
     }
     }
-    
+
 #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && !defined(AF_APP_EXTENSIONS)
 #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && !defined(AF_APP_EXTENSIONS)
     if (_backgroundTaskIdentifier) {
     if (_backgroundTaskIdentifier) {
         [[UIApplication sharedApplication] endBackgroundTask:_backgroundTaskIdentifier];
         [[UIApplication sharedApplication] endBackgroundTask:_backgroundTaskIdentifier];
@@ -297,14 +297,14 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
         __weak __typeof(self)weakSelf = self;
         __weak __typeof(self)weakSelf = self;
         self.backgroundTaskIdentifier = [application beginBackgroundTaskWithExpirationHandler:^{
         self.backgroundTaskIdentifier = [application beginBackgroundTaskWithExpirationHandler:^{
             __strong __typeof(weakSelf)strongSelf = weakSelf;
             __strong __typeof(weakSelf)strongSelf = weakSelf;
-            
+
             if (handler) {
             if (handler) {
                 handler();
                 handler();
             }
             }
-            
+
             if (strongSelf) {
             if (strongSelf) {
                 [strongSelf cancel];
                 [strongSelf cancel];
-                
+
                 [application endBackgroundTask:strongSelf.backgroundTaskIdentifier];
                 [application endBackgroundTask:strongSelf.backgroundTaskIdentifier];
                 strongSelf.backgroundTaskIdentifier = UIBackgroundTaskInvalid;
                 strongSelf.backgroundTaskIdentifier = UIBackgroundTaskInvalid;
             }
             }
@@ -320,11 +320,11 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
     if (!AFStateTransitionIsValid(self.state, state, [self isCancelled])) {
     if (!AFStateTransitionIsValid(self.state, state, [self isCancelled])) {
         return;
         return;
     }
     }
-    
+
     [self.lock lock];
     [self.lock lock];
     NSString *oldStateKey = AFKeyPathFromOperationState(self.state);
     NSString *oldStateKey = AFKeyPathFromOperationState(self.state);
     NSString *newStateKey = AFKeyPathFromOperationState(state);
     NSString *newStateKey = AFKeyPathFromOperationState(state);
-    
+
     [self willChangeValueForKey:newStateKey];
     [self willChangeValueForKey:newStateKey];
     [self willChangeValueForKey:oldStateKey];
     [self willChangeValueForKey:oldStateKey];
     _state = state;
     _state = state;
@@ -337,17 +337,17 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
     if ([self isPaused] || [self isFinished] || [self isCancelled]) {
     if ([self isPaused] || [self isFinished] || [self isCancelled]) {
         return;
         return;
     }
     }
-    
+
     [self.lock lock];
     [self.lock lock];
     if ([self isExecuting]) {
     if ([self isExecuting]) {
         [self performSelector:@selector(operationDidPause) onThread:[[self class] networkRequestThread] withObject:nil waitUntilDone:NO modes:[self.runLoopModes allObjects]];
         [self performSelector:@selector(operationDidPause) onThread:[[self class] networkRequestThread] withObject:nil waitUntilDone:NO modes:[self.runLoopModes allObjects]];
-        
+
         dispatch_async(dispatch_get_main_queue(), ^{
         dispatch_async(dispatch_get_main_queue(), ^{
             NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
             NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
             [notificationCenter postNotificationName:AFNetworkingOperationDidFinishNotification object:self];
             [notificationCenter postNotificationName:AFNetworkingOperationDidFinishNotification object:self];
         });
         });
     }
     }
-    
+
     self.state = AFOperationPausedState;
     self.state = AFOperationPausedState;
     [self.lock unlock];
     [self.lock unlock];
 }
 }
@@ -366,10 +366,10 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
     if (![self isPaused]) {
     if (![self isPaused]) {
         return;
         return;
     }
     }
-    
+
     [self.lock lock];
     [self.lock lock];
     self.state = AFOperationReadyState;
     self.state = AFOperationReadyState;
-    
+
     [self start];
     [self start];
     [self.lock unlock];
     [self.lock unlock];
 }
 }
@@ -447,7 +447,7 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
         [self performSelector:@selector(cancelConnection) onThread:[[self class] networkRequestThread] withObject:nil waitUntilDone:NO modes:[self.runLoopModes allObjects]];
         [self performSelector:@selector(cancelConnection) onThread:[[self class] networkRequestThread] withObject:nil waitUntilDone:NO modes:[self.runLoopModes allObjects]];
     } else if ([self isReady]) {
     } else if ([self isReady]) {
         self.state = AFOperationExecutingState;
         self.state = AFOperationExecutingState;
-        
+
         [self performSelector:@selector(operationDidStart) onThread:[[self class] networkRequestThread] withObject:nil waitUntilDone:NO modes:[self.runLoopModes allObjects]];
         [self performSelector:@selector(operationDidStart) onThread:[[self class] networkRequestThread] withObject:nil waitUntilDone:NO modes:[self.runLoopModes allObjects]];
     }
     }
     [self.lock unlock];
     [self.lock unlock];
@@ -457,18 +457,18 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
     [self.lock lock];
     [self.lock lock];
     if (![self isCancelled]) {
     if (![self isCancelled]) {
         self.connection = [[NSURLConnection alloc] initWithRequest:self.request delegate:self startImmediately:NO];
         self.connection = [[NSURLConnection alloc] initWithRequest:self.request delegate:self startImmediately:NO];
-        
+
         NSRunLoop *runLoop = [NSRunLoop currentRunLoop];
         NSRunLoop *runLoop = [NSRunLoop currentRunLoop];
         for (NSString *runLoopMode in self.runLoopModes) {
         for (NSString *runLoopMode in self.runLoopModes) {
             [self.connection scheduleInRunLoop:runLoop forMode:runLoopMode];
             [self.connection scheduleInRunLoop:runLoop forMode:runLoopMode];
             [self.outputStream scheduleInRunLoop:runLoop forMode:runLoopMode];
             [self.outputStream scheduleInRunLoop:runLoop forMode:runLoopMode];
         }
         }
-        
+
         [self.outputStream open];
         [self.outputStream open];
         [self.connection start];
         [self.connection start];
     }
     }
     [self.lock unlock];
     [self.lock unlock];
-    
+
     dispatch_async(dispatch_get_main_queue(), ^{
     dispatch_async(dispatch_get_main_queue(), ^{
         [[NSNotificationCenter defaultCenter] postNotificationName:AFNetworkingOperationDidStartNotification object:self];
         [[NSNotificationCenter defaultCenter] postNotificationName:AFNetworkingOperationDidStartNotification object:self];
     });
     });
@@ -661,13 +661,13 @@ didReceiveResponse:(NSURLResponse *)response
                 if (numberOfBytesWritten == -1) {
                 if (numberOfBytesWritten == -1) {
                     break;
                     break;
                 }
                 }
-                
+
                 totalNumberOfBytesWritten += numberOfBytesWritten;
                 totalNumberOfBytesWritten += numberOfBytesWritten;
             }
             }
 
 
             break;
             break;
         }
         }
-        
+
         if (self.outputStream.streamError) {
         if (self.outputStream.streamError) {
             [self.connection cancel];
             [self.connection cancel];
             [self performSelector:@selector(connection:didFailWithError:) withObject:self.connection withObject:self.outputStream.streamError];
             [self performSelector:@selector(connection:didFailWithError:) withObject:self.connection withObject:self.outputStream.streamError];
@@ -721,7 +721,7 @@ didReceiveResponse:(NSURLResponse *)response
         if ([self isCancelled]) {
         if ([self isCancelled]) {
             return nil;
             return nil;
         }
         }
-        
+
         return cachedResponse;
         return cachedResponse;
     }
     }
 }
 }
@@ -734,7 +734,7 @@ didReceiveResponse:(NSURLResponse *)response
 
 
 - (id)initWithCoder:(NSCoder *)decoder {
 - (id)initWithCoder:(NSCoder *)decoder {
     NSURLRequest *request = [decoder decodeObjectOfClass:[NSURLRequest class] forKey:NSStringFromSelector(@selector(request))];
     NSURLRequest *request = [decoder decodeObjectOfClass:[NSURLRequest class] forKey:NSStringFromSelector(@selector(request))];
-    
+
     self = [self initWithRequest:request];
     self = [self initWithRequest:request];
     if (!self) {
     if (!self) {
         return nil;
         return nil;
@@ -751,9 +751,9 @@ didReceiveResponse:(NSURLResponse *)response
 
 
 - (void)encodeWithCoder:(NSCoder *)coder {
 - (void)encodeWithCoder:(NSCoder *)coder {
     [self pause];
     [self pause];
-    
+
     [coder encodeObject:self.request forKey:NSStringFromSelector(@selector(request))];
     [coder encodeObject:self.request forKey:NSStringFromSelector(@selector(request))];
-    
+
     switch (self.state) {
     switch (self.state) {
         case AFOperationExecutingState:
         case AFOperationExecutingState:
         case AFOperationPausedState:
         case AFOperationPausedState:
@@ -763,7 +763,7 @@ didReceiveResponse:(NSURLResponse *)response
             [coder encodeInteger:self.state forKey:NSStringFromSelector(@selector(state))];
             [coder encodeInteger:self.state forKey:NSStringFromSelector(@selector(state))];
             break;
             break;
     }
     }
-    
+
     [coder encodeObject:self.response forKey:NSStringFromSelector(@selector(response))];
     [coder encodeObject:self.response forKey:NSStringFromSelector(@selector(response))];
     [coder encodeObject:self.error forKey:NSStringFromSelector(@selector(error))];
     [coder encodeObject:self.error forKey:NSStringFromSelector(@selector(error))];
     [coder encodeObject:self.responseData forKey:NSStringFromSelector(@selector(responseData))];
     [coder encodeObject:self.responseData forKey:NSStringFromSelector(@selector(responseData))];
@@ -774,7 +774,7 @@ didReceiveResponse:(NSURLResponse *)response
 
 
 - (id)copyWithZone:(NSZone *)zone {
 - (id)copyWithZone:(NSZone *)zone {
     AFURLConnectionOperation *operation = [(AFURLConnectionOperation *)[[self class] allocWithZone:zone] initWithRequest:self.request];
     AFURLConnectionOperation *operation = [(AFURLConnectionOperation *)[[self class] allocWithZone:zone] initWithRequest:self.request];
-    
+
     operation.uploadProgress = self.uploadProgress;
     operation.uploadProgress = self.uploadProgress;
     operation.downloadProgress = self.downloadProgress;
     operation.downloadProgress = self.downloadProgress;
     operation.authenticationChallenge = self.authenticationChallenge;
     operation.authenticationChallenge = self.authenticationChallenge;
@@ -782,7 +782,7 @@ didReceiveResponse:(NSURLResponse *)response
     operation.redirectResponse = self.redirectResponse;
     operation.redirectResponse = self.redirectResponse;
     operation.completionQueue = self.completionQueue;
     operation.completionQueue = self.completionQueue;
     operation.completionGroup = self.completionGroup;
     operation.completionGroup = self.completionGroup;
-    
+
     return operation;
     return operation;
 }
 }
 
 

+ 13 - 13
AFNetworking/AFURLRequestSerialization.h

@@ -1,6 +1,6 @@
 // AFURLRequestSerialization.h
 // AFURLRequestSerialization.h
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal
@@ -8,10 +8,10 @@
 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 // copies of the Software, and to permit persons to whom the Software is
 // copies of the Software, and to permit persons to whom the Software is
 // furnished to do so, subject to the following conditions:
 // furnished to do so, subject to the following conditions:
-// 
+//
 // The above copyright notice and this permission notice shall be included in
 // The above copyright notice and this permission notice shall be included in
 // all copies or substantial portions of the Software.
 // all copies or substantial portions of the Software.
-// 
+//
 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -72,42 +72,42 @@ typedef NS_ENUM(NSUInteger, AFHTTPRequestQueryStringSerializationStyle) {
 
 
 /**
 /**
  Whether created requests can use the device’s cellular radio (if present). `YES` by default.
  Whether created requests can use the device’s cellular radio (if present). `YES` by default.
- 
+
  @see NSMutableURLRequest -setAllowsCellularAccess:
  @see NSMutableURLRequest -setAllowsCellularAccess:
  */
  */
 @property (nonatomic, assign) BOOL allowsCellularAccess;
 @property (nonatomic, assign) BOOL allowsCellularAccess;
 
 
 /**
 /**
  The cache policy of created requests. `NSURLRequestUseProtocolCachePolicy` by default.
  The cache policy of created requests. `NSURLRequestUseProtocolCachePolicy` by default.
- 
+
  @see NSMutableURLRequest -setCachePolicy:
  @see NSMutableURLRequest -setCachePolicy:
  */
  */
 @property (nonatomic, assign) NSURLRequestCachePolicy cachePolicy;
 @property (nonatomic, assign) NSURLRequestCachePolicy cachePolicy;
 
 
 /**
 /**
  Whether created requests should use the default cookie handling. `YES` by default.
  Whether created requests should use the default cookie handling. `YES` by default.
- 
+
  @see NSMutableURLRequest -setHTTPShouldHandleCookies:
  @see NSMutableURLRequest -setHTTPShouldHandleCookies:
  */
  */
 @property (nonatomic, assign) BOOL HTTPShouldHandleCookies;
 @property (nonatomic, assign) BOOL HTTPShouldHandleCookies;
 
 
 /**
 /**
  Whether created requests can continue transmitting data before receiving a response from an earlier transmission. `NO` by default
  Whether created requests can continue transmitting data before receiving a response from an earlier transmission. `NO` by default
- 
+
  @see NSMutableURLRequest -setHTTPShouldUsePipelining:
  @see NSMutableURLRequest -setHTTPShouldUsePipelining:
  */
  */
 @property (nonatomic, assign) BOOL HTTPShouldUsePipelining;
 @property (nonatomic, assign) BOOL HTTPShouldUsePipelining;
 
 
 /**
 /**
  The network service type for created requests. `NSURLNetworkServiceTypeDefault` by default.
  The network service type for created requests. `NSURLNetworkServiceTypeDefault` by default.
- 
+
  @see NSMutableURLRequest -setNetworkServiceType:
  @see NSMutableURLRequest -setNetworkServiceType:
  */
  */
 @property (nonatomic, assign) NSURLRequestNetworkServiceType networkServiceType;
 @property (nonatomic, assign) NSURLRequestNetworkServiceType networkServiceType;
 
 
 /**
 /**
  The timeout interval, in seconds, for created requests. The default timeout interval is 60 seconds.
  The timeout interval, in seconds, for created requests. The default timeout interval is 60 seconds.
- 
+
  @see NSMutableURLRequest -setTimeoutInterval:
  @see NSMutableURLRequest -setTimeoutInterval:
  */
  */
 @property (nonatomic, assign) NSTimeInterval timeoutInterval;
 @property (nonatomic, assign) NSTimeInterval timeoutInterval;
@@ -139,7 +139,7 @@ forHTTPHeaderField:(NSString *)field;
  Returns the value for the HTTP headers set in the request serializer.
  Returns the value for the HTTP headers set in the request serializer.
 
 
  @param field The HTTP header to retrieve the default value for
  @param field The HTTP header to retrieve the default value for
- 
+
  @return The value set as default for the specified header, or `nil`
  @return The value set as default for the specified header, or `nil`
  */
  */
 - (NSString *)valueForHTTPHeaderField:(NSString *)field;
 - (NSString *)valueForHTTPHeaderField:(NSString *)field;
@@ -246,11 +246,11 @@ forHTTPHeaderField:(NSString *)field;
 
 
 /**
 /**
  Creates an `NSMutableURLRequest` by removing the `HTTPBodyStream` from a request, and asynchronously writing its contents into the specified file, invoking the completion handler when finished.
  Creates an `NSMutableURLRequest` by removing the `HTTPBodyStream` from a request, and asynchronously writing its contents into the specified file, invoking the completion handler when finished.
- 
+
  @param request The multipart form request. The `HTTPBodyStream` property of `request` must not be `nil`.
  @param request The multipart form request. The `HTTPBodyStream` property of `request` must not be `nil`.
  @param fileURL The file URL to write multipart form contents to.
  @param fileURL The file URL to write multipart form contents to.
  @param handler A handler block to execute.
  @param handler A handler block to execute.
- 
+
  @discussion There is a bug in `NSURLSessionTask` that causes requests to not send a `Content-Length` header when streaming contents from an HTTP body, which is notably problematic when interacting with the Amazon S3 webservice. As a workaround, this method takes a request constructed with `multipartFormRequestWithMethod:URLString:parameters:constructingBodyWithBlock:error:`, or any other request with an `HTTPBodyStream`, writes the contents to the specified file and returns a copy of the original request with the `HTTPBodyStream` property set to `nil`. From here, the file can either be passed to `AFURLSessionManager -uploadTaskWithRequest:fromFile:progress:completionHandler:`, or have its contents read into an `NSData` that's assigned to the `HTTPBody` property of the request.
  @discussion There is a bug in `NSURLSessionTask` that causes requests to not send a `Content-Length` header when streaming contents from an HTTP body, which is notably problematic when interacting with the Amazon S3 webservice. As a workaround, this method takes a request constructed with `multipartFormRequestWithMethod:URLString:parameters:constructingBodyWithBlock:error:`, or any other request with an `HTTPBodyStream`, writes the contents to the specified file and returns a copy of the original request with the `HTTPBodyStream` property set to `nil`. From here, the file can either be passed to `AFURLSessionManager -uploadTaskWithRequest:fromFile:progress:completionHandler:`, or have its contents read into an `NSData` that's assigned to the `HTTPBody` property of the request.
 
 
  @see https://github.com/AFNetworking/AFNetworking/issues/1398
  @see https://github.com/AFNetworking/AFNetworking/issues/1398
@@ -404,7 +404,7 @@ forHTTPHeaderField:(NSString *)field;
 
 
  @param format The property list format.
  @param format The property list format.
  @param writeOptions The property list write options.
  @param writeOptions The property list write options.
- 
+
  @warning The `writeOptions` property is currently unused.
  @warning The `writeOptions` property is currently unused.
  */
  */
 + (instancetype)serializerWithFormat:(NSPropertyListFormat)format
 + (instancetype)serializerWithFormat:(NSPropertyListFormat)format

+ 10 - 10
AFNetworking/AFURLRequestSerialization.m

@@ -1,6 +1,6 @@
 // AFURLRequestSerialization.m
 // AFURLRequestSerialization.m
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal
@@ -8,10 +8,10 @@
 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 // copies of the Software, and to permit persons to whom the Software is
 // copies of the Software, and to permit persons to whom the Software is
 // furnished to do so, subject to the following conditions:
 // furnished to do so, subject to the following conditions:
-// 
+//
 // The above copyright notice and this permission notice shall be included in
 // The above copyright notice and this permission notice shall be included in
 // all copies or substantial portions of the Software.
 // all copies or substantial portions of the Software.
-// 
+//
 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -154,7 +154,7 @@ NSArray * AFQueryStringPairsFromKeyAndValue(NSString *key, id value) {
     } else {
     } else {
         [mutableQueryStringComponents addObject:[[AFQueryStringPair alloc] initWithField:key value:value]];
         [mutableQueryStringComponents addObject:[[AFQueryStringPair alloc] initWithField:key value:value]];
     }
     }
-    
+
     return mutableQueryStringComponents;
     return mutableQueryStringComponents;
 }
 }
 
 
@@ -526,7 +526,7 @@ forHTTPHeaderField:(NSString *)field
     serializer.mutableHTTPRequestHeaders = [self.mutableHTTPRequestHeaders mutableCopyWithZone:zone];
     serializer.mutableHTTPRequestHeaders = [self.mutableHTTPRequestHeaders mutableCopyWithZone:zone];
     serializer.queryStringSerializationStyle = self.queryStringSerializationStyle;
     serializer.queryStringSerializationStyle = self.queryStringSerializationStyle;
     serializer.queryStringSerialization = self.queryStringSerialization;
     serializer.queryStringSerialization = self.queryStringSerialization;
-    
+
     return serializer;
     return serializer;
 }
 }
 
 
@@ -671,11 +671,11 @@ NSTimeInterval const kAFUploadStream3GSuggestedDelay = 0.2;
     if (!fileAttributes) {
     if (!fileAttributes) {
         return NO;
         return NO;
     }
     }
-    
+
     NSMutableDictionary *mutableHeaders = [NSMutableDictionary dictionary];
     NSMutableDictionary *mutableHeaders = [NSMutableDictionary dictionary];
     [mutableHeaders setValue:[NSString stringWithFormat:@"form-data; name=\"%@\"; filename=\"%@\"", name, fileName] forKey:@"Content-Disposition"];
     [mutableHeaders setValue:[NSString stringWithFormat:@"form-data; name=\"%@\"; filename=\"%@\"", name, fileName] forKey:@"Content-Disposition"];
     [mutableHeaders setValue:mimeType forKey:@"Content-Type"];
     [mutableHeaders setValue:mimeType forKey:@"Content-Type"];
-    
+
     AFHTTPBodyPart *bodyPart = [[AFHTTPBodyPart alloc] init];
     AFHTTPBodyPart *bodyPart = [[AFHTTPBodyPart alloc] init];
     bodyPart.stringEncoding = self.stringEncoding;
     bodyPart.stringEncoding = self.stringEncoding;
     bodyPart.headers = mutableHeaders;
     bodyPart.headers = mutableHeaders;
@@ -1164,13 +1164,13 @@ typedef enum {
 
 
 - (id)copyWithZone:(NSZone *)zone {
 - (id)copyWithZone:(NSZone *)zone {
     AFHTTPBodyPart *bodyPart = [[[self class] allocWithZone:zone] init];
     AFHTTPBodyPart *bodyPart = [[[self class] allocWithZone:zone] init];
-    
+
     bodyPart.stringEncoding = self.stringEncoding;
     bodyPart.stringEncoding = self.stringEncoding;
     bodyPart.headers = self.headers;
     bodyPart.headers = self.headers;
     bodyPart.bodyContentLength = self.bodyContentLength;
     bodyPart.bodyContentLength = self.bodyContentLength;
     bodyPart.body = self.body;
     bodyPart.body = self.body;
     bodyPart.boundary = self.boundary;
     bodyPart.boundary = self.boundary;
-    
+
     return bodyPart;
     return bodyPart;
 }
 }
 
 
@@ -1211,7 +1211,7 @@ typedef enum {
             [mutableRequest setValue:value forHTTPHeaderField:field];
             [mutableRequest setValue:value forHTTPHeaderField:field];
         }
         }
     }];
     }];
-    
+
     if (parameters) {
     if (parameters) {
         if (![mutableRequest valueForHTTPHeaderField:@"Content-Type"]) {
         if (![mutableRequest valueForHTTPHeaderField:@"Content-Type"]) {
             [mutableRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
             [mutableRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];

+ 4 - 4
AFNetworking/AFURLResponseSerialization.h

@@ -1,6 +1,6 @@
 // AFURLResponseSerialization.h
 // AFURLResponseSerialization.h
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal
@@ -8,10 +8,10 @@
 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 // copies of the Software, and to permit persons to whom the Software is
 // copies of the Software, and to permit persons to whom the Software is
 // furnished to do so, subject to the following conditions:
 // furnished to do so, subject to the following conditions:
-// 
+//
 // The above copyright notice and this permission notice shall be included in
 // The above copyright notice and this permission notice shall be included in
 // all copies or substantial portions of the Software.
 // all copies or substantial portions of the Software.
-// 
+//
 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -299,7 +299,7 @@ extern NSString * const AFURLResponseSerializationErrorDomain;
 
 
  `AFNetworkingOperationFailingURLResponseErrorKey`
  `AFNetworkingOperationFailingURLResponseErrorKey`
  The corresponding value is an `NSURLResponse` containing the response of the operation associated with an error. This key is only present in the `AFURLResponseSerializationErrorDomain`.
  The corresponding value is an `NSURLResponse` containing the response of the operation associated with an error. This key is only present in the `AFURLResponseSerializationErrorDomain`.
- 
+
  `AFNetworkingOperationFailingURLResponseDataErrorKey`
  `AFNetworkingOperationFailingURLResponseDataErrorKey`
  The corresponding value is an `NSData` containing the original data of the operation associated with an error. This key is only present in the `AFURLResponseSerializationErrorDomain`.
  The corresponding value is an `NSData` containing the original data of the operation associated with an error. This key is only present in the `AFURLResponseSerializationErrorDomain`.
  */
  */

+ 7 - 7
AFNetworking/AFURLResponseSerialization.m

@@ -1,6 +1,6 @@
 // AFURLResponseSerialization.m
 // AFURLResponseSerialization.m
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal
@@ -8,10 +8,10 @@
 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 // copies of the Software, and to permit persons to whom the Software is
 // copies of the Software, and to permit persons to whom the Software is
 // furnished to do so, subject to the following conditions:
 // furnished to do so, subject to the following conditions:
-// 
+//
 // The above copyright notice and this permission notice shall be included in
 // The above copyright notice and this permission notice shall be included in
 // all copies or substantial portions of the Software.
 // all copies or substantial portions of the Software.
-// 
+//
 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -276,11 +276,11 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO
     if (self.removesKeysWithNullValues && responseObject) {
     if (self.removesKeysWithNullValues && responseObject) {
         responseObject = AFJSONObjectByRemovingKeysWithNullValues(responseObject, self.readingOptions);
         responseObject = AFJSONObjectByRemovingKeysWithNullValues(responseObject, self.readingOptions);
     }
     }
-    
+
     if (error) {
     if (error) {
         *error = AFErrorWithUnderlyingError(serializationError, *error);
         *error = AFErrorWithUnderlyingError(serializationError, *error);
     }
     }
-    
+
     return responseObject;
     return responseObject;
 }
 }
 
 
@@ -622,7 +622,7 @@ static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *r
 
 
     CGImageRelease(inflatedImageRef);
     CGImageRelease(inflatedImageRef);
     CGImageRelease(imageRef);
     CGImageRelease(imageRef);
-    
+
     return inflatedImage;
     return inflatedImage;
 }
 }
 #endif
 #endif
@@ -758,7 +758,7 @@ static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *r
             return responseObject;
             return responseObject;
         }
         }
     }
     }
-    
+
     return [super responseObjectForResponse:response data:data error:error];
     return [super responseObjectForResponse:response data:data error:error];
 }
 }
 
 

+ 1 - 1
AFNetworking/AFURLSessionManager.h

@@ -1,6 +1,6 @@
 // AFURLSessionManager.h
 // AFURLSessionManager.h
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal

+ 12 - 12
AFNetworking/AFURLSessionManager.m

@@ -1,6 +1,6 @@
 // AFURLSessionManager.m
 // AFURLSessionManager.m
-// 
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal
@@ -8,10 +8,10 @@
 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 // copies of the Software, and to permit persons to whom the Software is
 // copies of the Software, and to permit persons to whom the Software is
 // furnished to do so, subject to the following conditions:
 // furnished to do so, subject to the following conditions:
-// 
+//
 // The above copyright notice and this permission notice shall be included in
 // The above copyright notice and this permission notice shall be included in
 // all copies or substantial portions of the Software.
 // all copies or substantial portions of the Software.
-// 
+//
 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -194,7 +194,7 @@ didCompleteWithError:(NSError *)error
                 if (self.completionHandler) {
                 if (self.completionHandler) {
                     self.completionHandler(task.response, responseObject, serializationError);
                     self.completionHandler(task.response, responseObject, serializationError);
                 }
                 }
-                
+
                 dispatch_async(dispatch_get_main_queue(), ^{
                 dispatch_async(dispatch_get_main_queue(), ^{
                     [[NSNotificationCenter defaultCenter] postNotificationName:AFNetworkingTaskDidCompleteNotification object:task userInfo:userInfo];
                     [[NSNotificationCenter defaultCenter] postNotificationName:AFNetworkingTaskDidCompleteNotification object:task userInfo:userInfo];
                 });
                 });
@@ -368,16 +368,16 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @"com.alamofi
 
 
     self.lock = [[NSLock alloc] init];
     self.lock = [[NSLock alloc] init];
     self.lock.name = AFURLSessionManagerLockName;
     self.lock.name = AFURLSessionManagerLockName;
-    
+
     [self.session getTasksWithCompletionHandler:^(NSArray *dataTasks, NSArray *uploadTasks, NSArray *downloadTasks) {
     [self.session getTasksWithCompletionHandler:^(NSArray *dataTasks, NSArray *uploadTasks, NSArray *downloadTasks) {
         for (NSURLSessionDataTask *task in dataTasks) {
         for (NSURLSessionDataTask *task in dataTasks) {
             [self addDelegateForDataTask:task completionHandler:nil];
             [self addDelegateForDataTask:task completionHandler:nil];
         }
         }
-        
+
         for (NSURLSessionUploadTask *uploadTask in uploadTasks) {
         for (NSURLSessionUploadTask *uploadTask in uploadTasks) {
             [self addDelegateForUploadTask:uploadTask progress:nil completionHandler:nil];
             [self addDelegateForUploadTask:uploadTask progress:nil completionHandler:nil];
         }
         }
-        
+
         for (NSURLSessionDownloadTask *downloadTask in downloadTasks) {
         for (NSURLSessionDownloadTask *downloadTask in downloadTasks) {
             [self addDelegateForDownloadTask:downloadTask progress:nil destination:nil completionHandler:nil];
             [self addDelegateForDownloadTask:downloadTask progress:nil destination:nil completionHandler:nil];
         }
         }
@@ -876,7 +876,7 @@ didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge
  needNewBodyStream:(void (^)(NSInputStream *bodyStream))completionHandler
  needNewBodyStream:(void (^)(NSInputStream *bodyStream))completionHandler
 {
 {
     NSInputStream *inputStream = nil;
     NSInputStream *inputStream = nil;
-    
+
     if (self.taskNeedNewBodyStream) {
     if (self.taskNeedNewBodyStream) {
         inputStream = self.taskNeedNewBodyStream(session, task);
         inputStream = self.taskNeedNewBodyStream(session, task);
     } else if (task.originalRequest.HTTPBodyStream && [task.originalRequest.HTTPBodyStream conformsToProtocol:@protocol(NSCopying)]) {
     } else if (task.originalRequest.HTTPBodyStream && [task.originalRequest.HTTPBodyStream conformsToProtocol:@protocol(NSCopying)]) {
@@ -894,7 +894,7 @@ didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge
     totalBytesSent:(int64_t)totalBytesSent
     totalBytesSent:(int64_t)totalBytesSent
 totalBytesExpectedToSend:(int64_t)totalBytesExpectedToSend
 totalBytesExpectedToSend:(int64_t)totalBytesExpectedToSend
 {
 {
-    
+
     int64_t totalUnitCount = totalBytesExpectedToSend;
     int64_t totalUnitCount = totalBytesExpectedToSend;
     if(totalUnitCount == NSURLSessionTransferSizeUnknown) {
     if(totalUnitCount == NSURLSessionTransferSizeUnknown) {
         NSString *contentLength = [task.originalRequest valueForHTTPHeaderField:@"Content-Length"];
         NSString *contentLength = [task.originalRequest valueForHTTPHeaderField:@"Content-Length"];
@@ -902,7 +902,7 @@ totalBytesExpectedToSend:(int64_t)totalBytesExpectedToSend
             totalUnitCount = (int64_t) [contentLength longLongValue];
             totalUnitCount = (int64_t) [contentLength longLongValue];
         }
         }
     }
     }
-    
+
     AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:task];
     AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:task];
     [delegate URLSession:session task:task didSendBodyData:bytesSent totalBytesSent:totalBytesSent totalBytesExpectedToSend:totalUnitCount];
     [delegate URLSession:session task:task didSendBodyData:bytesSent totalBytesSent:totalBytesSent totalBytesExpectedToSend:totalUnitCount];
 
 
@@ -1019,7 +1019,7 @@ didFinishDownloadingToURL:(NSURL *)location
             return;
             return;
         }
         }
     }
     }
-    
+
     if (delegate) {
     if (delegate) {
         [delegate URLSession:session downloadTask:downloadTask didFinishDownloadingToURL:location];
         [delegate URLSession:session downloadTask:downloadTask didFinishDownloadingToURL:location];
     }
     }

+ 1 - 1
Tests/Tests/1.0 Tests/AFHTTPClientTests.m

@@ -1,6 +1,6 @@
 // AFHTTPClientTests.m
 // AFHTTPClientTests.m
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal

+ 15 - 15
Tests/Tests/1.0 Tests/AFHTTPRequestOperationTests.m

@@ -1,6 +1,6 @@
 // AFHTTPRequestOperationTests.m
 // AFHTTPRequestOperationTests.m
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal
@@ -76,7 +76,7 @@
 
 
 - (void)testThatCancellationOfRequestOperationInvokesFailureCompletionBlock {
 - (void)testThatCancellationOfRequestOperationInvokesFailureCompletionBlock {
     __block NSError *blockError = nil;
     __block NSError *blockError = nil;
-    
+
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/5" relativeToURL:self.baseURL]];
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/5" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
     [operation setCompletionBlockWithSuccess:nil failure:^(AFHTTPRequestOperation *operation, NSError *error) {
     [operation setCompletionBlockWithSuccess:nil failure:^(AFHTTPRequestOperation *operation, NSError *error) {
@@ -100,7 +100,7 @@
     [operation setCompletionBlockWithSuccess:nil failure:^(AFHTTPRequestOperation *operation, NSError *error) {
     [operation setCompletionBlockWithSuccess:nil failure:^(AFHTTPRequestOperation *operation, NSError *error) {
         blockError = error;
         blockError = error;
     }];
     }];
-    
+
     [operation start];
     [operation start];
     expect([operation isFinished]).will.beTruthy();
     expect([operation isFinished]).will.beTruthy();
     expect(blockError).willNot.beNil();
     expect(blockError).willNot.beNil();
@@ -108,7 +108,7 @@
 
 
 - (void)testThatRedirectBlockIsCalledWhen302IsEncountered {
 - (void)testThatRedirectBlockIsCalledWhen302IsEncountered {
     __block BOOL success;
     __block BOOL success;
-    
+
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/redirect/1" relativeToURL:self.baseURL]];
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/redirect/1" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
     [operation setCompletionBlockWithSuccess:nil failure:nil];
     [operation setCompletionBlockWithSuccess:nil failure:nil];
@@ -119,7 +119,7 @@
 
 
         return request;
         return request;
     }];
     }];
-    
+
     [operation start];
     [operation start];
     expect([operation isFinished]).will.beTruthy();
     expect([operation isFinished]).will.beTruthy();
     expect(success).will.beTruthy();
     expect(success).will.beTruthy();
@@ -128,7 +128,7 @@
 - (void)testThatRedirectBlockIsCalledMultipleTimesWhenMultiple302sAreEncountered {
 - (void)testThatRedirectBlockIsCalledMultipleTimesWhenMultiple302sAreEncountered {
     [Expecta setAsynchronousTestTimeout:5.0];
     [Expecta setAsynchronousTestTimeout:5.0];
     __block NSInteger numberOfRedirects = 0;
     __block NSInteger numberOfRedirects = 0;
-    
+
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/redirect/5" relativeToURL:self.baseURL]];
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/redirect/5" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
     [operation setCompletionBlockWithSuccess:nil failure:nil];
     [operation setCompletionBlockWithSuccess:nil failure:nil];
@@ -136,7 +136,7 @@
         if(redirectResponse){
         if(redirectResponse){
             numberOfRedirects++;
             numberOfRedirects++;
         }
         }
-        
+
         return request;
         return request;
     }];
     }];
 
 
@@ -151,10 +151,10 @@
     [Expecta setAsynchronousTestTimeout:3.0];
     [Expecta setAsynchronousTestTimeout:3.0];
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/1" relativeToURL:self.baseURL]];
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/1" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
-    
+
     [operation start];
     [operation start];
     expect([operation isExecuting]).will.beTruthy();
     expect([operation isExecuting]).will.beTruthy();
-    
+
     [operation pause];
     [operation pause];
     expect([operation isPaused]).will.beTruthy();
     expect([operation isPaused]).will.beTruthy();
     [operation cancel];
     [operation cancel];
@@ -164,10 +164,10 @@
     [Expecta setAsynchronousTestTimeout:3.0];
     [Expecta setAsynchronousTestTimeout:3.0];
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/1" relativeToURL:self.baseURL]];
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/1" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
-    
+
     [operation start];
     [operation start];
     expect([operation isExecuting]).will.beTruthy();
     expect([operation isExecuting]).will.beTruthy();
-    
+
     [operation pause];
     [operation pause];
     expect([operation isPaused]).will.beTruthy();
     expect([operation isPaused]).will.beTruthy();
 
 
@@ -179,9 +179,9 @@
 
 
 - (void)testThatPausedOperationCanBeCompleted {
 - (void)testThatPausedOperationCanBeCompleted {
     [Expecta setAsynchronousTestTimeout:3.0];
     [Expecta setAsynchronousTestTimeout:3.0];
-    
+
     __block id blockResponseObject = nil;
     __block id blockResponseObject = nil;
-    
+
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/1" relativeToURL:self.baseURL]];
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/1" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
     [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
     [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
@@ -190,10 +190,10 @@
 
 
     [operation start];
     [operation start];
     expect([operation isExecuting]).will.beTruthy();
     expect([operation isExecuting]).will.beTruthy();
-    
+
     [operation pause];
     [operation pause];
     expect([operation isPaused]).will.beTruthy();
     expect([operation isPaused]).will.beTruthy();
-    
+
     [operation resume];
     [operation resume];
     expect([operation isExecuting]).will.beTruthy();
     expect([operation isExecuting]).will.beTruthy();
     expect([operation isFinished]).will.beTruthy();
     expect([operation isFinished]).will.beTruthy();

+ 1 - 1
Tests/Tests/1.0 Tests/AFImageRequestOperationTests.m

@@ -1,6 +1,6 @@
 // AFImageRequestOperationTests.m
 // AFImageRequestOperationTests.m
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal

+ 1 - 1
Tests/Tests/1.0 Tests/AFJSONRequestOperationTests.m

@@ -1,6 +1,6 @@
 // AFJSONRequestOperationTests.m
 // AFJSONRequestOperationTests.m
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal

+ 1 - 1
Tests/Tests/1.0 Tests/AFMockURLProtocol.h

@@ -1,6 +1,6 @@
 // AFMockURLProtocol.h
 // AFMockURLProtocol.h
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal

+ 1 - 1
Tests/Tests/1.0 Tests/AFMockURLProtocol.m

@@ -1,6 +1,6 @@
 // AFMockURLProtocol.m
 // AFMockURLProtocol.m
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal

+ 1 - 1
Tests/Tests/1.0 Tests/AFNetworkingTests.h

@@ -1,6 +1,6 @@
 // AFNetworkingTests.h
 // AFNetworkingTests.h
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal

+ 1 - 1
Tests/Tests/1.0 Tests/AFNetworkingTests.m

@@ -1,6 +1,6 @@
 // AFNetworkingTests.m
 // AFNetworkingTests.m
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal

+ 75 - 75
Tests/Tests/1.0 Tests/AFURLConnectionOperationTests.m

@@ -1,6 +1,6 @@
 // AFJSONRequestOperationTests.m
 // AFJSONRequestOperationTests.m
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal
@@ -39,28 +39,28 @@
 - (void)testThatAFURLConnectionOperationInvokesWillSendRequestForAuthenticationChallengeBlock {
 - (void)testThatAFURLConnectionOperationInvokesWillSendRequestForAuthenticationChallengeBlock {
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/path" relativeToURL:self.baseURL]];
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/path" relativeToURL:self.baseURL]];
     AFURLConnectionOperation *operation = [[AFURLConnectionOperation alloc] initWithRequest:request];
     AFURLConnectionOperation *operation = [[AFURLConnectionOperation alloc] initWithRequest:request];
-    
+
     __block BOOL willSendRequestForAuthenticationChallengeBlockInvoked = NO;
     __block BOOL willSendRequestForAuthenticationChallengeBlockInvoked = NO;
     [operation setWillSendRequestForAuthenticationChallengeBlock:^(NSURLConnection *connection, NSURLAuthenticationChallenge *challenge) {
     [operation setWillSendRequestForAuthenticationChallengeBlock:^(NSURLConnection *connection, NSURLAuthenticationChallenge *challenge) {
         willSendRequestForAuthenticationChallengeBlockInvoked = YES;
         willSendRequestForAuthenticationChallengeBlockInvoked = YES;
     }];
     }];
-    
+
     [AFMockURLProtocol handleNextRequestForURL:request.URL usingBlock:^(AFMockURLProtocol <AFMockURLProtocolProxy> * protocol) {
     [AFMockURLProtocol handleNextRequestForURL:request.URL usingBlock:^(AFMockURLProtocol <AFMockURLProtocolProxy> * protocol) {
-        
+
         void(^startOperation)(NSInvocation *invocation) = ^(NSInvocation *invocation) {
         void(^startOperation)(NSInvocation *invocation) = ^(NSInvocation *invocation) {
             __unsafe_unretained AFMockURLProtocol *protocol = nil;
             __unsafe_unretained AFMockURLProtocol *protocol = nil;
             [invocation getArgument:&protocol atIndex:0];
             [invocation getArgument:&protocol atIndex:0];
-            
+
             NSURLProtectionSpace *protectionSpace = [[NSURLProtectionSpace alloc] initWithHost:request.URL.host port:request.URL.port.integerValue protocol:request.URL.scheme realm:nil authenticationMethod:NSURLAuthenticationMethodDefault];
             NSURLProtectionSpace *protectionSpace = [[NSURLProtectionSpace alloc] initWithHost:request.URL.host port:request.URL.port.integerValue protocol:request.URL.scheme realm:nil authenticationMethod:NSURLAuthenticationMethodDefault];
             NSURLAuthenticationChallenge *authenticationChallenge = [[NSURLAuthenticationChallenge alloc] initWithProtectionSpace:protectionSpace proposedCredential:nil previousFailureCount:0 failureResponse:nil error:nil sender:protocol];
             NSURLAuthenticationChallenge *authenticationChallenge = [[NSURLAuthenticationChallenge alloc] initWithProtectionSpace:protectionSpace proposedCredential:nil previousFailureCount:0 failureResponse:nil error:nil sender:protocol];
             [protocol.client URLProtocol:protocol didReceiveAuthenticationChallenge:authenticationChallenge];
             [protocol.client URLProtocol:protocol didReceiveAuthenticationChallenge:authenticationChallenge];
         };
         };
         [[[protocol stub] andDo:startOperation] startLoading];
         [[[protocol stub] andDo:startOperation] startLoading];
     }];
     }];
-    
+
     [operation start];
     [operation start];
     expect(willSendRequestForAuthenticationChallengeBlockInvoked).will.beTruthy();
     expect(willSendRequestForAuthenticationChallengeBlockInvoked).will.beTruthy();
-    
+
     [operation cancel];
     [operation cancel];
 }
 }
 
 
@@ -68,55 +68,55 @@
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/path" relativeToURL:self.baseURL]];
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/path" relativeToURL:self.baseURL]];
     AFURLConnectionOperation *operation = [[AFURLConnectionOperation alloc] initWithRequest:request];
     AFURLConnectionOperation *operation = [[AFURLConnectionOperation alloc] initWithRequest:request];
     operation.SSLPinningMode = AFSSLPinningModeCertificate;
     operation.SSLPinningMode = AFSSLPinningModeCertificate;
-    
+
     __block BOOL useCredentialInvoked = NO;
     __block BOOL useCredentialInvoked = NO;
-    
+
     NSURLProtectionSpace *protectionSpace = [[NSURLProtectionSpace alloc] initWithHost:request.URL.host port:request.URL.port.integerValue protocol:request.URL.scheme realm:nil authenticationMethod:NSURLAuthenticationMethodServerTrust];
     NSURLProtectionSpace *protectionSpace = [[NSURLProtectionSpace alloc] initWithHost:request.URL.host port:request.URL.port.integerValue protocol:request.URL.scheme realm:nil authenticationMethod:NSURLAuthenticationMethodServerTrust];
-    
+
     NSData *certificateData = [NSData dataWithContentsOfFile:[[NSBundle bundleForClass:[self class]] pathForResource:@"root_certificate" ofType:@"cer"]];
     NSData *certificateData = [NSData dataWithContentsOfFile:[[NSBundle bundleForClass:[self class]] pathForResource:@"root_certificate" ofType:@"cer"]];
     NSParameterAssert(certificateData);
     NSParameterAssert(certificateData);
-    
+
     SecCertificateRef certificate = SecCertificateCreateWithData(NULL, (__bridge CFDataRef)certificateData);
     SecCertificateRef certificate = SecCertificateCreateWithData(NULL, (__bridge CFDataRef)certificateData);
     NSParameterAssert(certificate);
     NSParameterAssert(certificate);
-    
+
     SecCertificateRef allowedCertificates[] = {certificate};
     SecCertificateRef allowedCertificates[] = {certificate};
     CFArrayRef certificates = CFArrayCreate(NULL, (const void **)allowedCertificates, 1, NULL);
     CFArrayRef certificates = CFArrayCreate(NULL, (const void **)allowedCertificates, 1, NULL);
-    
+
     SecPolicyRef policy = SecPolicyCreateBasicX509();
     SecPolicyRef policy = SecPolicyCreateBasicX509();
     SecTrustRef trust = NULL;
     SecTrustRef trust = NULL;
     OSStatus status = SecTrustCreateWithCertificates(certificates, policy, &trust);
     OSStatus status = SecTrustCreateWithCertificates(certificates, policy, &trust);
     NSAssert(status == errSecSuccess, @"SecTrustCreateWithCertificates error: %ld", (long int)status);
     NSAssert(status == errSecSuccess, @"SecTrustCreateWithCertificates error: %ld", (long int)status);
-    
+
     SecTrustResultType result;
     SecTrustResultType result;
     status = SecTrustEvaluate(trust, &result);
     status = SecTrustEvaluate(trust, &result);
     NSAssert(status == errSecSuccess, @"SecTrustEvaluate error: %ld", (long int)status);
     NSAssert(status == errSecSuccess, @"SecTrustEvaluate error: %ld", (long int)status);
-    
+
     id mockedProtectionSpace = [OCMockObject partialMockForObject:protectionSpace];
     id mockedProtectionSpace = [OCMockObject partialMockForObject:protectionSpace];
-    
+
     [[[mockedProtectionSpace stub] andDo:^(NSInvocation *invocation) {
     [[[mockedProtectionSpace stub] andDo:^(NSInvocation *invocation) {
         [invocation setReturnValue:(void *)&trust];
         [invocation setReturnValue:(void *)&trust];
     }] serverTrust];
     }] serverTrust];
-    
+
     AFMockURLProtocol *protocol = [[AFMockURLProtocol alloc] initWithRequest:request cachedResponse:nil client:nil];
     AFMockURLProtocol *protocol = [[AFMockURLProtocol alloc] initWithRequest:request cachedResponse:nil client:nil];
     id mockedProtocol = [OCMockObject partialMockForObject:protocol];
     id mockedProtocol = [OCMockObject partialMockForObject:protocol];
-    
+
     void(^useCredential)(NSInvocation *invocation) = ^(NSInvocation *invocation) {
     void(^useCredential)(NSInvocation *invocation) = ^(NSInvocation *invocation) {
         useCredentialInvoked = YES;
         useCredentialInvoked = YES;
     };
     };
-    
+
     [[[mockedProtocol stub] andDo:useCredential] useCredential:OCMOCK_ANY forAuthenticationChallenge:OCMOCK_ANY];
     [[[mockedProtocol stub] andDo:useCredential] useCredential:OCMOCK_ANY forAuthenticationChallenge:OCMOCK_ANY];
-    
+
     NSURLCredential *credential = [[NSURLCredential alloc] initWithTrust:trust];
     NSURLCredential *credential = [[NSURLCredential alloc] initWithTrust:trust];
     NSURLAuthenticationChallenge *authenticationChallenge = [[NSURLAuthenticationChallenge alloc] initWithProtectionSpace:protectionSpace proposedCredential:credential previousFailureCount:0 failureResponse:nil error:nil sender:mockedProtocol];
     NSURLAuthenticationChallenge *authenticationChallenge = [[NSURLAuthenticationChallenge alloc] initWithProtectionSpace:protectionSpace proposedCredential:credential previousFailureCount:0 failureResponse:nil error:nil sender:mockedProtocol];
     [protocol.client URLProtocol:mockedProtocol didReceiveAuthenticationChallenge:authenticationChallenge];
     [protocol.client URLProtocol:mockedProtocol didReceiveAuthenticationChallenge:authenticationChallenge];
-    
+
     [operation connection:nil willSendRequestForAuthenticationChallenge:authenticationChallenge];
     [operation connection:nil willSendRequestForAuthenticationChallenge:authenticationChallenge];
-    
+
     CFRelease(trust);
     CFRelease(trust);
     CFRelease(policy);
     CFRelease(policy);
     CFRelease(certificates);
     CFRelease(certificates);
     CFRelease(certificate);
     CFRelease(certificate);
-    
+
     expect(useCredentialInvoked).will.beTruthy();
     expect(useCredentialInvoked).will.beTruthy();
 }
 }
 
 
@@ -124,55 +124,55 @@
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/path" relativeToURL:self.baseURL]];
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/path" relativeToURL:self.baseURL]];
     AFURLConnectionOperation *operation = [[AFURLConnectionOperation alloc] initWithRequest:request];
     AFURLConnectionOperation *operation = [[AFURLConnectionOperation alloc] initWithRequest:request];
     operation.SSLPinningMode = AFSSLPinningModePublicKey;
     operation.SSLPinningMode = AFSSLPinningModePublicKey;
-    
+
     __block BOOL useCredentialInvoked = NO;
     __block BOOL useCredentialInvoked = NO;
-    
+
     NSURLProtectionSpace *protectionSpace = [[NSURLProtectionSpace alloc] initWithHost:request.URL.host port:request.URL.port.integerValue protocol:request.URL.scheme realm:nil authenticationMethod:NSURLAuthenticationMethodServerTrust];
     NSURLProtectionSpace *protectionSpace = [[NSURLProtectionSpace alloc] initWithHost:request.URL.host port:request.URL.port.integerValue protocol:request.URL.scheme realm:nil authenticationMethod:NSURLAuthenticationMethodServerTrust];
-    
+
     NSData *certificateData = [NSData dataWithContentsOfFile:[[NSBundle bundleForClass:[self class]] pathForResource:@"root_certificate" ofType:@"cer"]];
     NSData *certificateData = [NSData dataWithContentsOfFile:[[NSBundle bundleForClass:[self class]] pathForResource:@"root_certificate" ofType:@"cer"]];
     NSParameterAssert(certificateData);
     NSParameterAssert(certificateData);
-    
+
     SecCertificateRef certificate = SecCertificateCreateWithData(NULL, (__bridge CFDataRef)certificateData);
     SecCertificateRef certificate = SecCertificateCreateWithData(NULL, (__bridge CFDataRef)certificateData);
     NSParameterAssert(certificate);
     NSParameterAssert(certificate);
-    
+
     SecCertificateRef allowedCertificates[] = {certificate};
     SecCertificateRef allowedCertificates[] = {certificate};
     CFArrayRef certificates = CFArrayCreate(NULL, (const void **)allowedCertificates, 1, NULL);
     CFArrayRef certificates = CFArrayCreate(NULL, (const void **)allowedCertificates, 1, NULL);
-    
+
     SecPolicyRef policy = SecPolicyCreateBasicX509();
     SecPolicyRef policy = SecPolicyCreateBasicX509();
     SecTrustRef trust = NULL;
     SecTrustRef trust = NULL;
     OSStatus status = SecTrustCreateWithCertificates(certificates, policy, &trust);
     OSStatus status = SecTrustCreateWithCertificates(certificates, policy, &trust);
     NSAssert(status == errSecSuccess, @"SecTrustCreateWithCertificates error: %ld", (long int)status);
     NSAssert(status == errSecSuccess, @"SecTrustCreateWithCertificates error: %ld", (long int)status);
-    
+
     SecTrustResultType result;
     SecTrustResultType result;
     status = SecTrustEvaluate(trust, &result);
     status = SecTrustEvaluate(trust, &result);
     NSAssert(status == errSecSuccess, @"SecTrustEvaluate error: %ld", (long int)status);
     NSAssert(status == errSecSuccess, @"SecTrustEvaluate error: %ld", (long int)status);
-    
+
     id mockedProtectionSpace = [OCMockObject partialMockForObject:protectionSpace];
     id mockedProtectionSpace = [OCMockObject partialMockForObject:protectionSpace];
-    
+
     [[[mockedProtectionSpace stub] andDo:^(NSInvocation *invocation) {
     [[[mockedProtectionSpace stub] andDo:^(NSInvocation *invocation) {
         [invocation setReturnValue:(void *)&trust];
         [invocation setReturnValue:(void *)&trust];
     }] serverTrust];
     }] serverTrust];
-    
+
     AFMockURLProtocol *protocol = [[AFMockURLProtocol alloc] initWithRequest:request cachedResponse:nil client:nil];
     AFMockURLProtocol *protocol = [[AFMockURLProtocol alloc] initWithRequest:request cachedResponse:nil client:nil];
     id mockedProtocol = [OCMockObject partialMockForObject:protocol];
     id mockedProtocol = [OCMockObject partialMockForObject:protocol];
-    
+
     void(^useCredential)(NSInvocation *invocation) = ^(NSInvocation *invocation) {
     void(^useCredential)(NSInvocation *invocation) = ^(NSInvocation *invocation) {
         useCredentialInvoked = YES;
         useCredentialInvoked = YES;
     };
     };
-    
+
     [[[mockedProtocol stub] andDo:useCredential] useCredential:OCMOCK_ANY forAuthenticationChallenge:OCMOCK_ANY];
     [[[mockedProtocol stub] andDo:useCredential] useCredential:OCMOCK_ANY forAuthenticationChallenge:OCMOCK_ANY];
-    
+
     NSURLCredential *credential = [[NSURLCredential alloc] initWithTrust:trust];
     NSURLCredential *credential = [[NSURLCredential alloc] initWithTrust:trust];
     NSURLAuthenticationChallenge *authenticationChallenge = [[NSURLAuthenticationChallenge alloc] initWithProtectionSpace:protectionSpace proposedCredential:credential previousFailureCount:0 failureResponse:nil error:nil sender:mockedProtocol];
     NSURLAuthenticationChallenge *authenticationChallenge = [[NSURLAuthenticationChallenge alloc] initWithProtectionSpace:protectionSpace proposedCredential:credential previousFailureCount:0 failureResponse:nil error:nil sender:mockedProtocol];
     [protocol.client URLProtocol:mockedProtocol didReceiveAuthenticationChallenge:authenticationChallenge];
     [protocol.client URLProtocol:mockedProtocol didReceiveAuthenticationChallenge:authenticationChallenge];
-    
+
     [operation connection:nil willSendRequestForAuthenticationChallenge:authenticationChallenge];
     [operation connection:nil willSendRequestForAuthenticationChallenge:authenticationChallenge];
-    
+
     CFRelease(trust);
     CFRelease(trust);
     CFRelease(policy);
     CFRelease(policy);
     CFRelease(certificates);
     CFRelease(certificates);
     CFRelease(certificate);
     CFRelease(certificate);
-    
+
     expect(useCredentialInvoked).will.beTruthy();
     expect(useCredentialInvoked).will.beTruthy();
 }
 }
 
 
@@ -180,62 +180,62 @@
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/path" relativeToURL:self.baseURL]];
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/path" relativeToURL:self.baseURL]];
     AFURLConnectionOperation *operation = [[AFURLConnectionOperation alloc] initWithRequest:request];
     AFURLConnectionOperation *operation = [[AFURLConnectionOperation alloc] initWithRequest:request];
     operation.SSLPinningMode = AFSSLPinningModePublicKey;
     operation.SSLPinningMode = AFSSLPinningModePublicKey;
-    
+
     __block BOOL useCredentialInvoked = NO;
     __block BOOL useCredentialInvoked = NO;
-    
+
     NSURLProtectionSpace *protectionSpace = [[NSURLProtectionSpace alloc] initWithHost:request.URL.host port:request.URL.port.integerValue protocol:request.URL.scheme realm:nil authenticationMethod:NSURLAuthenticationMethodServerTrust];
     NSURLProtectionSpace *protectionSpace = [[NSURLProtectionSpace alloc] initWithHost:request.URL.host port:request.URL.port.integerValue protocol:request.URL.scheme realm:nil authenticationMethod:NSURLAuthenticationMethodServerTrust];
-    
+
     NSData *caCertificateData = [NSData dataWithContentsOfFile:[[NSBundle bundleForClass:[self class]] pathForResource:@"ca" ofType:@"cer"]];
     NSData *caCertificateData = [NSData dataWithContentsOfFile:[[NSBundle bundleForClass:[self class]] pathForResource:@"ca" ofType:@"cer"]];
     NSParameterAssert(caCertificateData);
     NSParameterAssert(caCertificateData);
-    
+
     SecCertificateRef caCertificate = SecCertificateCreateWithData(NULL, (__bridge CFDataRef)caCertificateData);
     SecCertificateRef caCertificate = SecCertificateCreateWithData(NULL, (__bridge CFDataRef)caCertificateData);
     NSParameterAssert(caCertificate);
     NSParameterAssert(caCertificate);
-    
+
     NSData *hostCertificateData = [NSData dataWithContentsOfFile:[[NSBundle bundleForClass:[self class]] pathForResource:@"derived" ofType:@"cert"]];
     NSData *hostCertificateData = [NSData dataWithContentsOfFile:[[NSBundle bundleForClass:[self class]] pathForResource:@"derived" ofType:@"cert"]];
     NSParameterAssert(hostCertificateData);
     NSParameterAssert(hostCertificateData);
-    
+
     SecCertificateRef hostCertificate = SecCertificateCreateWithData(NULL, (__bridge CFDataRef)caCertificateData);
     SecCertificateRef hostCertificate = SecCertificateCreateWithData(NULL, (__bridge CFDataRef)caCertificateData);
     NSParameterAssert(hostCertificate);
     NSParameterAssert(hostCertificate);
-    
+
     SecCertificateRef allowedCertificates[] = {caCertificate, hostCertificate};
     SecCertificateRef allowedCertificates[] = {caCertificate, hostCertificate};
     CFArrayRef certificates = CFArrayCreate(NULL, (const void **)allowedCertificates, 2, NULL);
     CFArrayRef certificates = CFArrayCreate(NULL, (const void **)allowedCertificates, 2, NULL);
-    
+
     SecPolicyRef policy = SecPolicyCreateBasicX509();
     SecPolicyRef policy = SecPolicyCreateBasicX509();
     SecTrustRef trust = NULL;
     SecTrustRef trust = NULL;
     OSStatus status = SecTrustCreateWithCertificates(certificates, policy, &trust);
     OSStatus status = SecTrustCreateWithCertificates(certificates, policy, &trust);
     NSAssert(status == errSecSuccess, @"SecTrustCreateWithCertificates error: %ld", (long int)status);
     NSAssert(status == errSecSuccess, @"SecTrustCreateWithCertificates error: %ld", (long int)status);
-    
+
     SecTrustResultType result;
     SecTrustResultType result;
     status = SecTrustEvaluate(trust, &result);
     status = SecTrustEvaluate(trust, &result);
     NSAssert(status == errSecSuccess, @"SecTrustEvaluate error: %ld", (long int)status);
     NSAssert(status == errSecSuccess, @"SecTrustEvaluate error: %ld", (long int)status);
-    
+
     id mockedProtectionSpace = [OCMockObject partialMockForObject:protectionSpace];
     id mockedProtectionSpace = [OCMockObject partialMockForObject:protectionSpace];
-    
+
     [[[mockedProtectionSpace stub] andDo:^(NSInvocation *invocation) {
     [[[mockedProtectionSpace stub] andDo:^(NSInvocation *invocation) {
         [invocation setReturnValue:(void *)&trust];
         [invocation setReturnValue:(void *)&trust];
     }] serverTrust];
     }] serverTrust];
-    
+
     AFMockURLProtocol *protocol = [[AFMockURLProtocol alloc] initWithRequest:request cachedResponse:nil client:nil];
     AFMockURLProtocol *protocol = [[AFMockURLProtocol alloc] initWithRequest:request cachedResponse:nil client:nil];
     id mockedProtocol = [OCMockObject partialMockForObject:protocol];
     id mockedProtocol = [OCMockObject partialMockForObject:protocol];
-    
+
     void(^useCredential)(NSInvocation *invocation) = ^(NSInvocation *invocation) {
     void(^useCredential)(NSInvocation *invocation) = ^(NSInvocation *invocation) {
         useCredentialInvoked = YES;
         useCredentialInvoked = YES;
     };
     };
-    
+
     [[[mockedProtocol stub] andDo:useCredential] useCredential:OCMOCK_ANY forAuthenticationChallenge:OCMOCK_ANY];
     [[[mockedProtocol stub] andDo:useCredential] useCredential:OCMOCK_ANY forAuthenticationChallenge:OCMOCK_ANY];
-    
+
     NSURLCredential *credential = [[NSURLCredential alloc] initWithTrust:trust];
     NSURLCredential *credential = [[NSURLCredential alloc] initWithTrust:trust];
     NSURLAuthenticationChallenge *authenticationChallenge = [[NSURLAuthenticationChallenge alloc] initWithProtectionSpace:protectionSpace proposedCredential:credential previousFailureCount:0 failureResponse:nil error:nil sender:mockedProtocol];
     NSURLAuthenticationChallenge *authenticationChallenge = [[NSURLAuthenticationChallenge alloc] initWithProtectionSpace:protectionSpace proposedCredential:credential previousFailureCount:0 failureResponse:nil error:nil sender:mockedProtocol];
     [protocol.client URLProtocol:mockedProtocol didReceiveAuthenticationChallenge:authenticationChallenge];
     [protocol.client URLProtocol:mockedProtocol didReceiveAuthenticationChallenge:authenticationChallenge];
-    
+
     [operation connection:nil willSendRequestForAuthenticationChallenge:authenticationChallenge];
     [operation connection:nil willSendRequestForAuthenticationChallenge:authenticationChallenge];
-    
+
     CFRelease(trust);
     CFRelease(trust);
     CFRelease(policy);
     CFRelease(policy);
     CFRelease(certificates);
     CFRelease(certificates);
     CFRelease(caCertificate);
     CFRelease(caCertificate);
     CFRelease(hostCertificate);
     CFRelease(hostCertificate);
-    
+
     expect(useCredentialInvoked).will.beTruthy();
     expect(useCredentialInvoked).will.beTruthy();
 }
 }
 
 
@@ -243,62 +243,62 @@
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/path" relativeToURL:self.baseURL]];
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/path" relativeToURL:self.baseURL]];
     AFURLConnectionOperation *operation = [[AFURLConnectionOperation alloc] initWithRequest:request];
     AFURLConnectionOperation *operation = [[AFURLConnectionOperation alloc] initWithRequest:request];
     operation.SSLPinningMode = AFSSLPinningModeCertificate;
     operation.SSLPinningMode = AFSSLPinningModeCertificate;
-    
+
     __block BOOL useCredentialInvoked = NO;
     __block BOOL useCredentialInvoked = NO;
-    
+
     NSURLProtectionSpace *protectionSpace = [[NSURLProtectionSpace alloc] initWithHost:request.URL.host port:request.URL.port.integerValue protocol:request.URL.scheme realm:nil authenticationMethod:NSURLAuthenticationMethodServerTrust];
     NSURLProtectionSpace *protectionSpace = [[NSURLProtectionSpace alloc] initWithHost:request.URL.host port:request.URL.port.integerValue protocol:request.URL.scheme realm:nil authenticationMethod:NSURLAuthenticationMethodServerTrust];
-    
+
     NSData *caCertificateData = [NSData dataWithContentsOfFile:[[NSBundle bundleForClass:[self class]] pathForResource:@"ca" ofType:@"cer"]];
     NSData *caCertificateData = [NSData dataWithContentsOfFile:[[NSBundle bundleForClass:[self class]] pathForResource:@"ca" ofType:@"cer"]];
     NSParameterAssert(caCertificateData);
     NSParameterAssert(caCertificateData);
-    
+
     SecCertificateRef caCertificate = SecCertificateCreateWithData(NULL, (__bridge CFDataRef)caCertificateData);
     SecCertificateRef caCertificate = SecCertificateCreateWithData(NULL, (__bridge CFDataRef)caCertificateData);
     NSParameterAssert(caCertificate);
     NSParameterAssert(caCertificate);
-    
+
     NSData *hostCertificateData = [NSData dataWithContentsOfFile:[[NSBundle bundleForClass:[self class]] pathForResource:@"derived" ofType:@"cert"]];
     NSData *hostCertificateData = [NSData dataWithContentsOfFile:[[NSBundle bundleForClass:[self class]] pathForResource:@"derived" ofType:@"cert"]];
     NSParameterAssert(hostCertificateData);
     NSParameterAssert(hostCertificateData);
-    
+
     SecCertificateRef hostCertificate = SecCertificateCreateWithData(NULL, (__bridge CFDataRef)caCertificateData);
     SecCertificateRef hostCertificate = SecCertificateCreateWithData(NULL, (__bridge CFDataRef)caCertificateData);
     NSParameterAssert(hostCertificate);
     NSParameterAssert(hostCertificate);
-    
+
     SecCertificateRef allowedCertificates[] = {caCertificate, hostCertificate};
     SecCertificateRef allowedCertificates[] = {caCertificate, hostCertificate};
     CFArrayRef certificates = CFArrayCreate(NULL, (const void **)allowedCertificates, 2, NULL);
     CFArrayRef certificates = CFArrayCreate(NULL, (const void **)allowedCertificates, 2, NULL);
-    
+
     SecPolicyRef policy = SecPolicyCreateBasicX509();
     SecPolicyRef policy = SecPolicyCreateBasicX509();
     SecTrustRef trust = NULL;
     SecTrustRef trust = NULL;
     OSStatus status = SecTrustCreateWithCertificates(certificates, policy, &trust);
     OSStatus status = SecTrustCreateWithCertificates(certificates, policy, &trust);
     NSAssert(status == errSecSuccess, @"SecTrustCreateWithCertificates error: %ld", (long int)status);
     NSAssert(status == errSecSuccess, @"SecTrustCreateWithCertificates error: %ld", (long int)status);
-    
+
     SecTrustResultType result;
     SecTrustResultType result;
     status = SecTrustEvaluate(trust, &result);
     status = SecTrustEvaluate(trust, &result);
     NSAssert(status == errSecSuccess, @"SecTrustEvaluate error: %ld", (long int)status);
     NSAssert(status == errSecSuccess, @"SecTrustEvaluate error: %ld", (long int)status);
-    
+
     id mockedProtectionSpace = [OCMockObject partialMockForObject:protectionSpace];
     id mockedProtectionSpace = [OCMockObject partialMockForObject:protectionSpace];
-    
+
     [[[mockedProtectionSpace stub] andDo:^(NSInvocation *invocation) {
     [[[mockedProtectionSpace stub] andDo:^(NSInvocation *invocation) {
         [invocation setReturnValue:(void *)&trust];
         [invocation setReturnValue:(void *)&trust];
     }] serverTrust];
     }] serverTrust];
-    
+
     AFMockURLProtocol *protocol = [[AFMockURLProtocol alloc] initWithRequest:request cachedResponse:nil client:nil];
     AFMockURLProtocol *protocol = [[AFMockURLProtocol alloc] initWithRequest:request cachedResponse:nil client:nil];
     id mockedProtocol = [OCMockObject partialMockForObject:protocol];
     id mockedProtocol = [OCMockObject partialMockForObject:protocol];
-    
+
     void(^useCredential)(NSInvocation *invocation) = ^(NSInvocation *invocation) {
     void(^useCredential)(NSInvocation *invocation) = ^(NSInvocation *invocation) {
         useCredentialInvoked = YES;
         useCredentialInvoked = YES;
     };
     };
-    
+
     [[[mockedProtocol stub] andDo:useCredential] useCredential:OCMOCK_ANY forAuthenticationChallenge:OCMOCK_ANY];
     [[[mockedProtocol stub] andDo:useCredential] useCredential:OCMOCK_ANY forAuthenticationChallenge:OCMOCK_ANY];
-    
+
     NSURLCredential *credential = [[NSURLCredential alloc] initWithTrust:trust];
     NSURLCredential *credential = [[NSURLCredential alloc] initWithTrust:trust];
     NSURLAuthenticationChallenge *authenticationChallenge = [[NSURLAuthenticationChallenge alloc] initWithProtectionSpace:protectionSpace proposedCredential:credential previousFailureCount:0 failureResponse:nil error:nil sender:mockedProtocol];
     NSURLAuthenticationChallenge *authenticationChallenge = [[NSURLAuthenticationChallenge alloc] initWithProtectionSpace:protectionSpace proposedCredential:credential previousFailureCount:0 failureResponse:nil error:nil sender:mockedProtocol];
     [protocol.client URLProtocol:mockedProtocol didReceiveAuthenticationChallenge:authenticationChallenge];
     [protocol.client URLProtocol:mockedProtocol didReceiveAuthenticationChallenge:authenticationChallenge];
-    
+
     [operation connection:nil willSendRequestForAuthenticationChallenge:authenticationChallenge];
     [operation connection:nil willSendRequestForAuthenticationChallenge:authenticationChallenge];
-    
+
     CFRelease(trust);
     CFRelease(trust);
     CFRelease(policy);
     CFRelease(policy);
     CFRelease(certificates);
     CFRelease(certificates);
     CFRelease(caCertificate);
     CFRelease(caCertificate);
     CFRelease(hostCertificate);
     CFRelease(hostCertificate);
-    
+
     expect(useCredentialInvoked).will.beTruthy();
     expect(useCredentialInvoked).will.beTruthy();
 }
 }
 
 

+ 54 - 54
Tests/Tests/AFHTTPRequestOperationTests.m

@@ -1,6 +1,6 @@
 // AFHTTPRequestOperationTests.m
 // AFHTTPRequestOperationTests.m
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal
@@ -35,10 +35,10 @@
 // The tests should be better encapsulated - setUp and tearDown should reset the state of the network thread.
 // The tests should be better encapsulated - setUp and tearDown should reset the state of the network thread.
 - (void)testPauseResumeStallsNetworkThread {
 - (void)testPauseResumeStallsNetworkThread {
     [Expecta setAsynchronousTestTimeout:5.0];
     [Expecta setAsynchronousTestTimeout:5.0];
-    
+
     __block id blockResponseObject = nil;
     __block id blockResponseObject = nil;
     __block id blockError = nil;
     __block id blockError = nil;
-    
+
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/1" relativeToURL:self.baseURL]];
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/1" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
     [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
     [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
@@ -46,7 +46,7 @@
     } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
     } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
         blockError = error;
         blockError = error;
     }];
     }];
-    
+
     // FLAKY: For this test to correctly fail, 'pause' must happen on the main thread before the network thread has run the logic of 'start'.
     // FLAKY: For this test to correctly fail, 'pause' must happen on the main thread before the network thread has run the logic of 'start'.
     // The non-intrusive fix to this is to create fine grained control over the starting/stopping of the network thread, rather than having the network thread continually process events in the background.
     // The non-intrusive fix to this is to create fine grained control over the starting/stopping of the network thread, rather than having the network thread continually process events in the background.
 
 
@@ -56,14 +56,14 @@
     [operation start];
     [operation start];
     [operation pause];
     [operation pause];
     expect([operation isPaused]).will.beTruthy();
     expect([operation isPaused]).will.beTruthy();
-    
+
     // Resume the operation.
     // Resume the operation.
     [operation resume];
     [operation resume];
     expect([operation isExecuting]).will.beTruthy();
     expect([operation isExecuting]).will.beTruthy();
     expect([operation isFinished]).will.beTruthy();
     expect([operation isFinished]).will.beTruthy();
     expect(blockError).will.beNil();
     expect(blockError).will.beNil();
     expect(blockResponseObject).willNot.beNil();
     expect(blockResponseObject).willNot.beNil();
-    
+
     // The first operation completed, but the network thread is now in an infinite loop.
     // The first operation completed, but the network thread is now in an infinite loop.
     // Future requests should not work.
     // Future requests should not work.
     blockResponseObject = nil;
     blockResponseObject = nil;
@@ -73,7 +73,7 @@
     } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
     } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
         blockError = error;
         blockError = error;
     }];
     }];
-    
+
     // The network thread is stalled, so this operation could not succeed.
     // The network thread is stalled, so this operation could not succeed.
     [operation2 start];
     [operation2 start];
     expect(blockError).will.beNil();
     expect(blockError).will.beNil();
@@ -83,16 +83,16 @@
 - (void)testThatOperationInvokesSuccessCompletionBlockWithResponseObjectOnSuccess {
 - (void)testThatOperationInvokesSuccessCompletionBlockWithResponseObjectOnSuccess {
     __block id blockResponseObject = nil;
     __block id blockResponseObject = nil;
     __block id blockError = nil;
     __block id blockError = nil;
-    
+
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/get" relativeToURL:self.baseURL]];
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/get" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
-    
+
     [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
     [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
         blockResponseObject = responseObject;
         blockResponseObject = responseObject;
     } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
     } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
         blockError = error;
         blockError = error;
     }];
     }];
-    
+
     [operation start];
     [operation start];
 
 
     expect([operation isFinished]).will.beTruthy();
     expect([operation isFinished]).will.beTruthy();
@@ -122,14 +122,14 @@
 
 
 - (void)testThatOperationInvokesFailureCompletionBlockWithErrorOnFailure {
 - (void)testThatOperationInvokesFailureCompletionBlockWithErrorOnFailure {
     __block NSError *blockError = nil;
     __block NSError *blockError = nil;
-    
+
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/status/404" relativeToURL:self.baseURL]];
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/status/404" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
-    
+
     [operation setCompletionBlockWithSuccess:nil failure:^(AFHTTPRequestOperation *operation, NSError *error) {
     [operation setCompletionBlockWithSuccess:nil failure:^(AFHTTPRequestOperation *operation, NSError *error) {
         blockError = error;
         blockError = error;
     }];
     }];
-    
+
     [operation start];
     [operation start];
     expect([operation isFinished]).will.beTruthy();
     expect([operation isFinished]).will.beTruthy();
     expect(blockError).willNot.beNil();
     expect(blockError).willNot.beNil();
@@ -138,10 +138,10 @@
 - (void)testThatCancellationOfRequestOperationSetsError {
 - (void)testThatCancellationOfRequestOperationSetsError {
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/5" relativeToURL:self.baseURL]];
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/5" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
-    
+
     [operation start];
     [operation start];
     expect([operation isExecuting]).will.beTruthy();
     expect([operation isExecuting]).will.beTruthy();
-    
+
     [operation cancel];
     [operation cancel];
     expect(operation.error).willNot.beNil();
     expect(operation.error).willNot.beNil();
     expect(operation.error.code).to.equal(NSURLErrorCancelled);
     expect(operation.error.code).to.equal(NSURLErrorCancelled);
@@ -149,17 +149,17 @@
 
 
 - (void)testThatCancellationOfRequestOperationInvokesFailureCompletionBlock {
 - (void)testThatCancellationOfRequestOperationInvokesFailureCompletionBlock {
     __block NSError *blockError = nil;
     __block NSError *blockError = nil;
-    
+
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/5" relativeToURL:self.baseURL]];
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/5" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
-    
+
     [operation setCompletionBlockWithSuccess:nil failure:^(AFHTTPRequestOperation *operation, NSError *error) {
     [operation setCompletionBlockWithSuccess:nil failure:^(AFHTTPRequestOperation *operation, NSError *error) {
         blockError = error;
         blockError = error;
     }];
     }];
-    
+
     [operation start];
     [operation start];
     expect([operation isExecuting]).will.beTruthy();
     expect([operation isExecuting]).will.beTruthy();
-    
+
     [operation cancel];
     [operation cancel];
     expect(operation.error).willNot.beNil();
     expect(operation.error).willNot.beNil();
     expect(blockError).willNot.beNil();
     expect(blockError).willNot.beNil();
@@ -168,21 +168,21 @@
 
 
 - (void)testThatCancellationOfRequestBeforeStartingRequestSetsError {
 - (void)testThatCancellationOfRequestBeforeStartingRequestSetsError {
     __block NSError *blockError = nil;
     __block NSError *blockError = nil;
-    
+
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/5" relativeToURL:self.baseURL]];
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/5" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
-    
+
     [operation setCompletionBlockWithSuccess:nil failure:^(AFHTTPRequestOperation *operation, NSError *error) {
     [operation setCompletionBlockWithSuccess:nil failure:^(AFHTTPRequestOperation *operation, NSError *error) {
         blockError = error;
         blockError = error;
     }];
     }];
-    
+
     [operation cancel];
     [operation cancel];
     [operation start];
     [operation start];
-    
+
     expect([operation isCancelled]).will.beTruthy();
     expect([operation isCancelled]).will.beTruthy();
     expect([operation isFinished]).will.beTruthy();
     expect([operation isFinished]).will.beTruthy();
     expect([operation isExecuting]).will.beFalsy();
     expect([operation isExecuting]).will.beFalsy();
-    
+
     expect(operation.error).willNot.beNil();
     expect(operation.error).willNot.beNil();
     expect(blockError).willNot.beNil();
     expect(blockError).willNot.beNil();
     expect(blockError.code).will.equal(NSURLErrorCancelled);
     expect(blockError.code).will.equal(NSURLErrorCancelled);
@@ -190,17 +190,17 @@
 
 
 - (void)testThatCancellationOfRequestBeforeStartingRequestSetsErrorInvokesFailureCompletionBlock {
 - (void)testThatCancellationOfRequestBeforeStartingRequestSetsErrorInvokesFailureCompletionBlock {
     __block NSError *blockError = nil;
     __block NSError *blockError = nil;
-    
+
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/5" relativeToURL:self.baseURL]];
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/5" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
 
 
     [operation setCompletionBlockWithSuccess:nil failure:^(AFHTTPRequestOperation *operation, NSError *error) {
     [operation setCompletionBlockWithSuccess:nil failure:^(AFHTTPRequestOperation *operation, NSError *error) {
         blockError = error;
         blockError = error;
     }];
     }];
-    
+
     [operation cancel];
     [operation cancel];
     [operation start];
     [operation start];
-    
+
     expect(operation.error).willNot.beNil();
     expect(operation.error).willNot.beNil();
     expect(blockError).willNot.beNil();
     expect(blockError).willNot.beNil();
     expect(blockError.code).will.equal(NSURLErrorCancelled);
     expect(blockError.code).will.equal(NSURLErrorCancelled);
@@ -208,14 +208,14 @@
 
 
 - (void)testThat500StatusCodeInvokesFailureCompletionBlockWithErrorOnFailure {
 - (void)testThat500StatusCodeInvokesFailureCompletionBlockWithErrorOnFailure {
     __block NSError *blockError = nil;
     __block NSError *blockError = nil;
-    
+
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/status/500" relativeToURL:self.baseURL]];
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/status/500" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
 
 
     [operation setCompletionBlockWithSuccess:nil failure:^(AFHTTPRequestOperation *operation, NSError *error) {
     [operation setCompletionBlockWithSuccess:nil failure:^(AFHTTPRequestOperation *operation, NSError *error) {
         blockError = error;
         blockError = error;
     }];
     }];
-    
+
     [operation start];
     [operation start];
     expect([operation isFinished]).will.beTruthy();
     expect([operation isFinished]).will.beTruthy();
     expect(blockError).willNot.beNil();
     expect(blockError).willNot.beNil();
@@ -224,7 +224,7 @@
 - (void)testThatRedirectBlockIsCalledWhen302IsEncountered {
 - (void)testThatRedirectBlockIsCalledWhen302IsEncountered {
     __block BOOL success;
     __block BOOL success;
     __block NSError *blockError = nil;
     __block NSError *blockError = nil;
-    
+
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/redirect/1" relativeToURL:self.baseURL]];
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/redirect/1" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
 
 
@@ -235,10 +235,10 @@
         if(redirectResponse){
         if(redirectResponse){
             success = YES;
             success = YES;
         }
         }
-        
+
         return request;
         return request;
     }];
     }];
-    
+
     [operation start];
     [operation start];
     expect([operation isFinished]).will.beTruthy();
     expect([operation isFinished]).will.beTruthy();
     expect(blockError).will.beNil();
     expect(blockError).will.beNil();
@@ -249,7 +249,7 @@
     [Expecta setAsynchronousTestTimeout:5.0];
     [Expecta setAsynchronousTestTimeout:5.0];
     __block NSInteger numberOfRedirects = 0;
     __block NSInteger numberOfRedirects = 0;
     __block NSError *blockError = nil;
     __block NSError *blockError = nil;
-    
+
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/redirect/5" relativeToURL:self.baseURL]];
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/redirect/5" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
 
 
@@ -260,10 +260,10 @@
         if(redirectResponse){
         if(redirectResponse){
             numberOfRedirects++;
             numberOfRedirects++;
         }
         }
-        
+
         return request;
         return request;
     }];
     }];
-    
+
     [operation start];
     [operation start];
     expect([operation isFinished]).will.beTruthy();
     expect([operation isFinished]).will.beTruthy();
     expect(blockError).will.beNil();
     expect(blockError).will.beNil();
@@ -276,10 +276,10 @@
     [Expecta setAsynchronousTestTimeout:3.0];
     [Expecta setAsynchronousTestTimeout:3.0];
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/1" relativeToURL:self.baseURL]];
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/1" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
-    
+
     [operation start];
     [operation start];
     expect([operation isExecuting]).will.beTruthy();
     expect([operation isExecuting]).will.beTruthy();
-    
+
     [operation pause];
     [operation pause];
     expect([operation isPaused]).will.beTruthy();
     expect([operation isPaused]).will.beTruthy();
     [operation cancel];
     [operation cancel];
@@ -292,22 +292,22 @@
 
 
     [operation start];
     [operation start];
     expect([operation isExecuting]).will.beTruthy();
     expect([operation isExecuting]).will.beTruthy();
-    
+
     [operation pause];
     [operation pause];
     expect([operation isPaused]).will.beTruthy();
     expect([operation isPaused]).will.beTruthy();
-    
+
     [operation resume];
     [operation resume];
     expect([operation isExecuting]).will.beTruthy();
     expect([operation isExecuting]).will.beTruthy();
-    
+
     [operation cancel];
     [operation cancel];
 }
 }
 
 
 - (void)testThatPausedOperationCanBeCompleted {
 - (void)testThatPausedOperationCanBeCompleted {
     [Expecta setAsynchronousTestTimeout:3.0];
     [Expecta setAsynchronousTestTimeout:3.0];
-    
+
     __block id blockResponseObject = nil;
     __block id blockResponseObject = nil;
     __block id blockError = nil;
     __block id blockError = nil;
-    
+
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/1" relativeToURL:self.baseURL]];
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/1" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
     [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
     [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
@@ -315,13 +315,13 @@
     } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
     } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
         blockError = error;
         blockError = error;
     }];
     }];
-    
+
     [operation start];
     [operation start];
     expect([operation isExecuting]).will.beTruthy();
     expect([operation isExecuting]).will.beTruthy();
-    
+
     [operation pause];
     [operation pause];
     expect([operation isPaused]).will.beTruthy();
     expect([operation isPaused]).will.beTruthy();
-    
+
     [operation resume];
     [operation resume];
     expect([operation isExecuting]).will.beTruthy();
     expect([operation isExecuting]).will.beTruthy();
     expect([operation isFinished]).will.beTruthy();
     expect([operation isFinished]).will.beTruthy();
@@ -332,25 +332,25 @@
 - (void)testThatOperationPostsDidStartNotificationWhenStarted {
 - (void)testThatOperationPostsDidStartNotificationWhenStarted {
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/get" relativeToURL:self.baseURL]];
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/get" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
-    
+
     __block BOOL notificationFound;
     __block BOOL notificationFound;
-    
+
     id observer = [[NSNotificationCenter defaultCenter] addObserverForName:AFNetworkingOperationDidStartNotification object:nil queue:nil usingBlock:^(NSNotification *note) {
     id observer = [[NSNotificationCenter defaultCenter] addObserverForName:AFNetworkingOperationDidStartNotification object:nil queue:nil usingBlock:^(NSNotification *note) {
         if([[[note object] request] isEqual:operation.request]){
         if([[[note object] request] isEqual:operation.request]){
             notificationFound = YES;
             notificationFound = YES;
         }
         }
     }];
     }];
-    
+
     [operation start];
     [operation start];
     expect(notificationFound).will.beTruthy();
     expect(notificationFound).will.beTruthy();
-    
+
     [[NSNotificationCenter defaultCenter] removeObserver:observer];
     [[NSNotificationCenter defaultCenter] removeObserver:observer];
 }
 }
 
 
 - (void)testThatOperationPostsDidFinishNotificationWhenFinished {
 - (void)testThatOperationPostsDidFinishNotificationWhenFinished {
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/get" relativeToURL:self.baseURL]];
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/get" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
-    
+
     __block BOOL notificationFound;
     __block BOOL notificationFound;
 
 
     id observer = [[NSNotificationCenter defaultCenter] addObserverForName:AFNetworkingOperationDidFinishNotification object:nil queue:nil usingBlock:^(NSNotification *note) {
     id observer = [[NSNotificationCenter defaultCenter] addObserverForName:AFNetworkingOperationDidFinishNotification object:nil queue:nil usingBlock:^(NSNotification *note) {
@@ -358,10 +358,10 @@
             notificationFound = YES;
             notificationFound = YES;
         }
         }
     }];
     }];
-    
+
     [operation start];
     [operation start];
     expect(notificationFound).will.beTruthy();
     expect(notificationFound).will.beTruthy();
-    
+
     [[NSNotificationCenter defaultCenter] removeObserver:observer];
     [[NSNotificationCenter defaultCenter] removeObserver:observer];
 }
 }
 
 
@@ -379,7 +379,7 @@
         firstBlockError = error;
         firstBlockError = error;
     }];
     }];
     [operation1 setResponseSerializer:[AFHTTPResponseSerializer serializer]];
     [operation1 setResponseSerializer:[AFHTTPResponseSerializer serializer]];
-    
+
     NSURLRequest *request2 = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/1" relativeToURL:self.baseURL]];
     NSURLRequest *request2 = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/1" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation2 = [[AFHTTPRequestOperation alloc] initWithRequest:request2];
     AFHTTPRequestOperation *operation2 = [[AFHTTPRequestOperation alloc] initWithRequest:request2];
     [operation2 setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
     [operation2 setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
@@ -388,7 +388,7 @@
         secondBlockError = error;
         secondBlockError = error;
     }];
     }];
     [operation2 setResponseSerializer:[AFHTTPResponseSerializer serializer]];
     [operation2 setResponseSerializer:[AFHTTPResponseSerializer serializer]];
-    
+
     __block BOOL completionBlockFiredAfterOtherBlocks = NO;
     __block BOOL completionBlockFiredAfterOtherBlocks = NO;
     NSArray *batchRequests = [AFURLConnectionOperation batchOfRequestOperations:@[operation1, operation2] progressBlock:nil completionBlock:^(NSArray *operations) {
     NSArray *batchRequests = [AFURLConnectionOperation batchOfRequestOperations:@[operation1, operation2] progressBlock:nil completionBlock:^(NSArray *operations) {
         if (firstBlock && secondBlock) {
         if (firstBlock && secondBlock) {

+ 6 - 6
Tests/Tests/AFHTTPRequestSerializationTests.m

@@ -1,6 +1,6 @@
 // AFHTTPSerializationTests.m
 // AFHTTPSerializationTests.m
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal
@@ -96,7 +96,7 @@
 
 
          return query;
          return query;
      }];
      }];
-    
+
     NSURLRequest *originalRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://example.com"]];
     NSURLRequest *originalRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://example.com"]];
     NSURLRequest *serializedRequest = [self.requestSerializer requestBySerializingRequest:originalRequest withParameters:@{@"key":@"value"} error:nil];
     NSURLRequest *serializedRequest = [self.requestSerializer requestBySerializingRequest:originalRequest withParameters:@{@"key":@"value"} error:nil];
 
 
@@ -107,13 +107,13 @@
     NSMutableURLRequest *originalRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://example.com"]];
     NSMutableURLRequest *originalRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://example.com"]];
     Class streamClass = NSClassFromString(@"AFStreamingMultipartFormData");
     Class streamClass = NSClassFromString(@"AFStreamingMultipartFormData");
     id <AFMultipartFormDataTest> formData = [[streamClass alloc] initWithURLRequest:originalRequest stringEncoding:NSUTF8StringEncoding];
     id <AFMultipartFormDataTest> formData = [[streamClass alloc] initWithURLRequest:originalRequest stringEncoding:NSUTF8StringEncoding];
-    
+
     NSURL *fileURL = [NSURL fileURLWithPath:[[NSBundle bundleForClass:[self class]] pathForResource:@"adn_0" ofType:@"cer"]];
     NSURL *fileURL = [NSURL fileURLWithPath:[[NSBundle bundleForClass:[self class]] pathForResource:@"adn_0" ofType:@"cer"]];
-    
+
     [formData appendPartWithFileURL:fileURL name:@"test" error:NULL];
     [formData appendPartWithFileURL:fileURL name:@"test" error:NULL];
-    
+
     AFHTTPBodyPart *part = [formData.bodyStream.HTTPBodyParts firstObject];
     AFHTTPBodyPart *part = [formData.bodyStream.HTTPBodyParts firstObject];
-    
+
     XCTAssertTrue([part.headers[@"Content-Type"] isEqualToString:@"application/x-x509-ca-cert"], @"MIME Type has not been obtained correctly (%@)", part.headers[@"Content-Type"]);
     XCTAssertTrue([part.headers[@"Content-Type"] isEqualToString:@"application/x-x509-ca-cert"], @"MIME Type has not been obtained correctly (%@)", part.headers[@"Content-Type"]);
 }
 }
 
 

+ 1 - 1
Tests/Tests/AFHTTPResponseSerializationTests.m

@@ -1,6 +1,6 @@
 // AFHTTPResponseSerializationTests.m
 // AFHTTPResponseSerializationTests.m
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal

+ 3 - 3
Tests/Tests/AFHTTPSessionManagerTests.m

@@ -1,6 +1,6 @@
 // AFHTTPSessionManagerTests.m
 // AFHTTPSessionManagerTests.m
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal
@@ -104,7 +104,7 @@
         NSURL *dirURL  = [[[NSFileManager defaultManager] URLsForDirectory:NSLibraryDirectory inDomains:NSUserDomainMask] lastObject];
         NSURL *dirURL  = [[[NSFileManager defaultManager] URLsForDirectory:NSLibraryDirectory inDomains:NSUserDomainMask] lastObject];
         return [dirURL URLByAppendingPathComponent:@"t1.file"];
         return [dirURL URLByAppendingPathComponent:@"t1.file"];
     }];
     }];
-    
+
     NSURLSessionDownloadTask *downloadTask = [self.manager downloadTaskWithRequest:[NSURLRequest requestWithURL:self.baseURL]
     NSURLSessionDownloadTask *downloadTask = [self.manager downloadTaskWithRequest:[NSURLRequest requestWithURL:self.baseURL]
                                                                           progress:nil
                                                                           progress:nil
                                                                        destination:nil
                                                                        destination:nil
@@ -122,7 +122,7 @@
     __block BOOL destinationBlockExecuted = NO;
     __block BOOL destinationBlockExecuted = NO;
     __block BOOL completionBlockExecuted = NO;
     __block BOOL completionBlockExecuted = NO;
     __block NSURL *downloadFilePath = nil;
     __block NSURL *downloadFilePath = nil;
-    
+
     NSURLSessionDownloadTask *downloadTask = [self.manager downloadTaskWithRequest:[NSURLRequest requestWithURL:self.baseURL]
     NSURLSessionDownloadTask *downloadTask = [self.manager downloadTaskWithRequest:[NSURLRequest requestWithURL:self.baseURL]
                                                                           progress:nil
                                                                           progress:nil
                                                                        destination:^NSURL *(NSURL *targetPath, NSURLResponse *response) {
                                                                        destination:^NSURL *(NSURL *targetPath, NSURLResponse *response) {

+ 2 - 2
Tests/Tests/AFJSONSerializationTests.m

@@ -1,6 +1,6 @@
 // AFJSONSerializationTests.m
 // AFJSONSerializationTests.m
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal
@@ -134,4 +134,4 @@ static NSData * AFJSONTestData() {
     XCTAssertNotNil(error, @"Serialization error should not be nil");
     XCTAssertNotNil(error, @"Serialization error should not be nil");
 }
 }
 
 
-@end
+@end

+ 5 - 5
Tests/Tests/AFNetworkActivityManagerTests.m

@@ -1,6 +1,6 @@
 // AFNetworkActivityManagerTests.m
 // AFNetworkActivityManagerTests.m
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal
@@ -61,7 +61,7 @@
     [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
     [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
         expect([self.mockApplication isNetworkActivityIndicatorVisible]).will.beFalsy();
         expect([self.mockApplication isNetworkActivityIndicatorVisible]).will.beFalsy();
     } failure:nil];
     } failure:nil];
-    
+
     [operation start];
     [operation start];
 
 
     expect([self.mockApplication isNetworkActivityIndicatorVisible]).will.beTruthy();
     expect([self.mockApplication isNetworkActivityIndicatorVisible]).will.beTruthy();
@@ -73,9 +73,9 @@
     [operation setCompletionBlockWithSuccess:nil failure:^(AFHTTPRequestOperation *operation, NSError *error) {
     [operation setCompletionBlockWithSuccess:nil failure:^(AFHTTPRequestOperation *operation, NSError *error) {
         expect([self.mockApplication isNetworkActivityIndicatorVisible]).will.beFalsy();
         expect([self.mockApplication isNetworkActivityIndicatorVisible]).will.beFalsy();
     }];
     }];
-    
+
     [operation start];
     [operation start];
-    
+
     expect([self.mockApplication isNetworkActivityIndicatorVisible]).will.beTruthy();
     expect([self.mockApplication isNetworkActivityIndicatorVisible]).will.beTruthy();
 }
 }
 
 
@@ -93,7 +93,7 @@
     [operation setCompletionBlockWithSuccess:nil failure:nil];
     [operation setCompletionBlockWithSuccess:nil failure:nil];
 
 
     [operation start];
     [operation start];
-    
+
     expect(didChangeNetworkActivityIndicatorVisible).will.beFalsy();
     expect(didChangeNetworkActivityIndicatorVisible).will.beFalsy();
 }
 }
 
 

+ 1 - 1
Tests/Tests/AFPropertyListResponseSerializerTests.m

@@ -1,6 +1,6 @@
 // AFPropertyListResponseSerializerTests.m
 // AFPropertyListResponseSerializerTests.m
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal

+ 35 - 35
Tests/Tests/AFSecurityPolicyTests.m

@@ -1,6 +1,6 @@
 // AFSecurityPolicyTests.m
 // AFSecurityPolicyTests.m
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal
@@ -70,7 +70,7 @@ static SecCertificateRef AFUTGeotrustRootCertificate() {
     NSString *certPath = [[NSBundle bundleForClass:[AFSecurityPolicyTests class]] pathForResource:@"Geotrust_Root_CA" ofType:@"cer"];
     NSString *certPath = [[NSBundle bundleForClass:[AFSecurityPolicyTests class]] pathForResource:@"Geotrust_Root_CA" ofType:@"cer"];
     NSCAssert(certPath != nil, @"Path for certificate should not be nil");
     NSCAssert(certPath != nil, @"Path for certificate should not be nil");
     NSData *certData = [NSData dataWithContentsOfFile:certPath];
     NSData *certData = [NSData dataWithContentsOfFile:certPath];
-    
+
     return SecCertificateCreateWithData(NULL, (__bridge CFDataRef)(certData));
     return SecCertificateCreateWithData(NULL, (__bridge CFDataRef)(certData));
 }
 }
 
 
@@ -78,7 +78,7 @@ static SecCertificateRef AFUTRapidSSLCertificate() {
     NSString *certPath = [[NSBundle bundleForClass:[AFSecurityPolicyTests class]] pathForResource:@"Rapid_SSL_CA" ofType:@"cer"];
     NSString *certPath = [[NSBundle bundleForClass:[AFSecurityPolicyTests class]] pathForResource:@"Rapid_SSL_CA" ofType:@"cer"];
     NSCAssert(certPath != nil, @"Path for certificate should not be nil");
     NSCAssert(certPath != nil, @"Path for certificate should not be nil");
     NSData *certData = [NSData dataWithContentsOfFile:certPath];
     NSData *certData = [NSData dataWithContentsOfFile:certPath];
-    
+
     return SecCertificateCreateWithData(NULL, (__bridge CFDataRef)(certData));
     return SecCertificateCreateWithData(NULL, (__bridge CFDataRef)(certData));
 }
 }
 
 
@@ -109,12 +109,12 @@ static SecCertificateRef AFUTSelfSignedCertificateWithDNSNameDomain() {
 static NSArray * AFCertificateTrustChainForServerTrust(SecTrustRef serverTrust) {
 static NSArray * AFCertificateTrustChainForServerTrust(SecTrustRef serverTrust) {
     CFIndex certificateCount = SecTrustGetCertificateCount(serverTrust);
     CFIndex certificateCount = SecTrustGetCertificateCount(serverTrust);
     NSMutableArray *trustChain = [NSMutableArray arrayWithCapacity:(NSUInteger)certificateCount];
     NSMutableArray *trustChain = [NSMutableArray arrayWithCapacity:(NSUInteger)certificateCount];
-    
+
     for (CFIndex i = 0; i < certificateCount; i++) {
     for (CFIndex i = 0; i < certificateCount; i++) {
         SecCertificateRef certificate = SecTrustGetCertificateAtIndex(serverTrust, i);
         SecCertificateRef certificate = SecTrustGetCertificateAtIndex(serverTrust, i);
         [trustChain addObject:(__bridge_transfer NSData *)SecCertificateCopyData(certificate)];
         [trustChain addObject:(__bridge_transfer NSData *)SecCertificateCopyData(certificate)];
     }
     }
-    
+
     return [NSArray arrayWithArray:trustChain];
     return [NSArray arrayWithArray:trustChain];
 }
 }
 
 
@@ -139,17 +139,17 @@ static SecTrustRef AFUTTrustWithCertificate(SecCertificateRef certificate) {
     SecCertificateRef geotrustRootCertificate = AFUTGeotrustRootCertificate();
     SecCertificateRef geotrustRootCertificate = AFUTGeotrustRootCertificate();
     SecCertificateRef rapidSSLCertificate = AFUTRapidSSLCertificate();
     SecCertificateRef rapidSSLCertificate = AFUTRapidSSLCertificate();
     SecCertificateRef httpBinCertificate = AFUTHTTPBinOrgCertificate();
     SecCertificateRef httpBinCertificate = AFUTHTTPBinOrgCertificate();
-    
+
     [policy setPinnedCertificates:@[(__bridge_transfer NSData *)SecCertificateCopyData(geotrustRootCertificate),
     [policy setPinnedCertificates:@[(__bridge_transfer NSData *)SecCertificateCopyData(geotrustRootCertificate),
                                     (__bridge_transfer NSData *)SecCertificateCopyData(rapidSSLCertificate),
                                     (__bridge_transfer NSData *)SecCertificateCopyData(rapidSSLCertificate),
                                     (__bridge_transfer NSData *)SecCertificateCopyData(httpBinCertificate)]];
                                     (__bridge_transfer NSData *)SecCertificateCopyData(httpBinCertificate)]];
-    
+
     CFRelease(geotrustRootCertificate);
     CFRelease(geotrustRootCertificate);
     CFRelease(rapidSSLCertificate);
     CFRelease(rapidSSLCertificate);
     CFRelease(httpBinCertificate);
     CFRelease(httpBinCertificate);
-    
+
     [policy setValidatesCertificateChain:NO];
     [policy setValidatesCertificateChain:NO];
-    
+
     SecTrustRef trust = AFUTHTTPBinOrgServerTrust();
     SecTrustRef trust = AFUTHTTPBinOrgServerTrust();
     XCTAssert([policy evaluateServerTrust:trust forDomain:nil], @"HTTPBin.org Public Key Pinning Mode Failed");
     XCTAssert([policy evaluateServerTrust:trust forDomain:nil], @"HTTPBin.org Public Key Pinning Mode Failed");
     CFRelease(trust);
     CFRelease(trust);
@@ -174,17 +174,17 @@ static SecTrustRef AFUTTrustWithCertificate(SecCertificateRef certificate) {
     SecCertificateRef geotrustRootCertificate = AFUTGeotrustRootCertificate();
     SecCertificateRef geotrustRootCertificate = AFUTGeotrustRootCertificate();
     SecCertificateRef rapidSSLCertificate = AFUTRapidSSLCertificate();
     SecCertificateRef rapidSSLCertificate = AFUTRapidSSLCertificate();
     SecCertificateRef httpBinCertificate = AFUTHTTPBinOrgCertificate();
     SecCertificateRef httpBinCertificate = AFUTHTTPBinOrgCertificate();
-    
+
     [policy setPinnedCertificates:@[(__bridge_transfer NSData *)SecCertificateCopyData(geotrustRootCertificate),
     [policy setPinnedCertificates:@[(__bridge_transfer NSData *)SecCertificateCopyData(geotrustRootCertificate),
                                     (__bridge_transfer NSData *)SecCertificateCopyData(rapidSSLCertificate),
                                     (__bridge_transfer NSData *)SecCertificateCopyData(rapidSSLCertificate),
                                     (__bridge_transfer NSData *)SecCertificateCopyData(httpBinCertificate)]];
                                     (__bridge_transfer NSData *)SecCertificateCopyData(httpBinCertificate)]];
-    
+
     CFRelease(geotrustRootCertificate);
     CFRelease(geotrustRootCertificate);
     CFRelease(rapidSSLCertificate);
     CFRelease(rapidSSLCertificate);
     CFRelease(httpBinCertificate);
     CFRelease(httpBinCertificate);
-    
+
     [policy setValidatesCertificateChain:NO];
     [policy setValidatesCertificateChain:NO];
-    
+
     SecTrustRef trust = AFUTHTTPBinOrgServerTrust();
     SecTrustRef trust = AFUTHTTPBinOrgServerTrust();
     XCTAssert([policy evaluateServerTrust:trust forDomain:nil], @"HTTPBin.org Public Key Pinning Mode Failed");
     XCTAssert([policy evaluateServerTrust:trust forDomain:nil], @"HTTPBin.org Public Key Pinning Mode Failed");
     CFRelease(trust);
     CFRelease(trust);
@@ -226,21 +226,21 @@ static SecTrustRef AFUTTrustWithCertificate(SecCertificateRef certificate) {
 
 
 - (void)testCertificatePinningIsEnforcedForHTTPBinOrgPinnedCertificateWithDomainNameValidationAgainstHTTPBinOrgServerTrust {
 - (void)testCertificatePinningIsEnforcedForHTTPBinOrgPinnedCertificateWithDomainNameValidationAgainstHTTPBinOrgServerTrust {
     AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeCertificate];
     AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeCertificate];
-    
+
     SecCertificateRef geotrustRootCertificate = AFUTGeotrustRootCertificate();
     SecCertificateRef geotrustRootCertificate = AFUTGeotrustRootCertificate();
     SecCertificateRef rapidSSLCertificate = AFUTRapidSSLCertificate();
     SecCertificateRef rapidSSLCertificate = AFUTRapidSSLCertificate();
     SecCertificateRef httpBinCertificate = AFUTHTTPBinOrgCertificate();
     SecCertificateRef httpBinCertificate = AFUTHTTPBinOrgCertificate();
-    
+
     [policy setPinnedCertificates:@[(__bridge_transfer NSData *)SecCertificateCopyData(geotrustRootCertificate),
     [policy setPinnedCertificates:@[(__bridge_transfer NSData *)SecCertificateCopyData(geotrustRootCertificate),
                                     (__bridge_transfer NSData *)SecCertificateCopyData(rapidSSLCertificate),
                                     (__bridge_transfer NSData *)SecCertificateCopyData(rapidSSLCertificate),
                                     (__bridge_transfer NSData *)SecCertificateCopyData(httpBinCertificate)]];
                                     (__bridge_transfer NSData *)SecCertificateCopyData(httpBinCertificate)]];
-    
+
     CFRelease(geotrustRootCertificate);
     CFRelease(geotrustRootCertificate);
     CFRelease(rapidSSLCertificate);
     CFRelease(rapidSSLCertificate);
     CFRelease(httpBinCertificate);
     CFRelease(httpBinCertificate);
-    
+
     policy.validatesDomainName = YES;
     policy.validatesDomainName = YES;
-    
+
     SecTrustRef trust = AFUTHTTPBinOrgServerTrust();
     SecTrustRef trust = AFUTHTTPBinOrgServerTrust();
     XCTAssert([policy evaluateServerTrust:trust forDomain:@"httpbin.org"], @"HTTPBin.org Public Key Pinning Mode Failed");
     XCTAssert([policy evaluateServerTrust:trust forDomain:@"httpbin.org"], @"HTTPBin.org Public Key Pinning Mode Failed");
     CFRelease(trust);
     CFRelease(trust);
@@ -248,19 +248,19 @@ static SecTrustRef AFUTTrustWithCertificate(SecCertificateRef certificate) {
 
 
 - (void)testCertificatePinningIsEnforcedForHTTPBinOrgPinnedCertificateWithCaseInsensitiveDomainNameValidationAgainstHTTPBinOrgServerTrust {
 - (void)testCertificatePinningIsEnforcedForHTTPBinOrgPinnedCertificateWithCaseInsensitiveDomainNameValidationAgainstHTTPBinOrgServerTrust {
     AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModePublicKey];
     AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModePublicKey];
-    
+
     SecCertificateRef geotrustRootCertificate = AFUTGeotrustRootCertificate();
     SecCertificateRef geotrustRootCertificate = AFUTGeotrustRootCertificate();
     SecCertificateRef rapidSSLCertificate = AFUTRapidSSLCertificate();
     SecCertificateRef rapidSSLCertificate = AFUTRapidSSLCertificate();
     SecCertificateRef httpBinCertificate = AFUTHTTPBinOrgCertificate();
     SecCertificateRef httpBinCertificate = AFUTHTTPBinOrgCertificate();
-    
+
     [policy setPinnedCertificates:@[(__bridge_transfer NSData *)SecCertificateCopyData(geotrustRootCertificate),
     [policy setPinnedCertificates:@[(__bridge_transfer NSData *)SecCertificateCopyData(geotrustRootCertificate),
                                     (__bridge_transfer NSData *)SecCertificateCopyData(rapidSSLCertificate),
                                     (__bridge_transfer NSData *)SecCertificateCopyData(rapidSSLCertificate),
                                     (__bridge_transfer NSData *)SecCertificateCopyData(httpBinCertificate)]];
                                     (__bridge_transfer NSData *)SecCertificateCopyData(httpBinCertificate)]];
-    
+
     CFRelease(geotrustRootCertificate);
     CFRelease(geotrustRootCertificate);
     CFRelease(rapidSSLCertificate);
     CFRelease(rapidSSLCertificate);
     CFRelease(httpBinCertificate);
     CFRelease(httpBinCertificate);
-    
+
     policy.validatesDomainName = YES;
     policy.validatesDomainName = YES;
 
 
     SecTrustRef trust = AFUTHTTPBinOrgServerTrust();
     SecTrustRef trust = AFUTHTTPBinOrgServerTrust();
@@ -270,21 +270,21 @@ static SecTrustRef AFUTTrustWithCertificate(SecCertificateRef certificate) {
 
 
 - (void)testCertificatePinningIsEnforcedForHTTPBinOrgPinnedPublicKeyWithDomainNameValidationAgainstHTTPBinOrgServerTrust {
 - (void)testCertificatePinningIsEnforcedForHTTPBinOrgPinnedPublicKeyWithDomainNameValidationAgainstHTTPBinOrgServerTrust {
     AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModePublicKey];
     AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModePublicKey];
-    
+
     SecCertificateRef geotrustRootCertificate = AFUTGeotrustRootCertificate();
     SecCertificateRef geotrustRootCertificate = AFUTGeotrustRootCertificate();
     SecCertificateRef rapidSSLCertificate = AFUTRapidSSLCertificate();
     SecCertificateRef rapidSSLCertificate = AFUTRapidSSLCertificate();
     SecCertificateRef httpBinCertificate = AFUTHTTPBinOrgCertificate();
     SecCertificateRef httpBinCertificate = AFUTHTTPBinOrgCertificate();
-    
+
     [policy setPinnedCertificates:@[(__bridge_transfer NSData *)SecCertificateCopyData(geotrustRootCertificate),
     [policy setPinnedCertificates:@[(__bridge_transfer NSData *)SecCertificateCopyData(geotrustRootCertificate),
                                     (__bridge_transfer NSData *)SecCertificateCopyData(rapidSSLCertificate),
                                     (__bridge_transfer NSData *)SecCertificateCopyData(rapidSSLCertificate),
                                     (__bridge_transfer NSData *)SecCertificateCopyData(httpBinCertificate)]];
                                     (__bridge_transfer NSData *)SecCertificateCopyData(httpBinCertificate)]];
-    
+
     CFRelease(geotrustRootCertificate);
     CFRelease(geotrustRootCertificate);
     CFRelease(rapidSSLCertificate);
     CFRelease(rapidSSLCertificate);
     CFRelease(httpBinCertificate);
     CFRelease(httpBinCertificate);
-    
+
     policy.validatesDomainName = YES;
     policy.validatesDomainName = YES;
-    
+
     SecTrustRef trust = AFUTHTTPBinOrgServerTrust();
     SecTrustRef trust = AFUTHTTPBinOrgServerTrust();
     XCTAssert([policy evaluateServerTrust:trust forDomain:@"httpbin.org"], @"HTTPBin.org Public Key Pinning Mode Failed");
     XCTAssert([policy evaluateServerTrust:trust forDomain:@"httpbin.org"], @"HTTPBin.org Public Key Pinning Mode Failed");
     CFRelease(trust);
     CFRelease(trust);
@@ -293,7 +293,7 @@ static SecTrustRef AFUTTrustWithCertificate(SecCertificateRef certificate) {
 - (void)testCertificatePinningFailsForHTTPBinOrgIfNoCertificateIsPinned {
 - (void)testCertificatePinningFailsForHTTPBinOrgIfNoCertificateIsPinned {
     AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeCertificate];
     AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeCertificate];
     [policy setPinnedCertificates:@[]];
     [policy setPinnedCertificates:@[]];
-    
+
     SecTrustRef trust = AFUTHTTPBinOrgServerTrust();
     SecTrustRef trust = AFUTHTTPBinOrgServerTrust();
     XCTAssert([policy evaluateServerTrust:trust forDomain:@"httpbin.org"] == NO, @"HTTPBin.org Certificate Pinning Should have failed with no pinned certificate");
     XCTAssert([policy evaluateServerTrust:trust forDomain:@"httpbin.org"] == NO, @"HTTPBin.org Certificate Pinning Should have failed with no pinned certificate");
     CFRelease(trust);
     CFRelease(trust);
@@ -305,7 +305,7 @@ static SecTrustRef AFUTTrustWithCertificate(SecCertificateRef certificate) {
     [policy setPinnedCertificates:@[(__bridge_transfer NSData *)SecCertificateCopyData(certificate)]];
     [policy setPinnedCertificates:@[(__bridge_transfer NSData *)SecCertificateCopyData(certificate)]];
     CFRelease(certificate);
     CFRelease(certificate);
     policy.validatesDomainName = YES;
     policy.validatesDomainName = YES;
-    
+
     SecTrustRef trust = AFUTHTTPBinOrgServerTrust();
     SecTrustRef trust = AFUTHTTPBinOrgServerTrust();
     XCTAssert([policy evaluateServerTrust:trust forDomain:@"www.httpbin.org"] == NO, @"HTTPBin.org Certificate Pinning Should have failed with no pinned certificate");
     XCTAssert([policy evaluateServerTrust:trust forDomain:@"www.httpbin.org"] == NO, @"HTTPBin.org Certificate Pinning Should have failed with no pinned certificate");
     CFRelease(trust);
     CFRelease(trust);
@@ -465,10 +465,10 @@ static SecTrustRef AFUTTrustWithCertificate(SecCertificateRef certificate) {
 
 
 - (void)testDefaultPolicySetToCertificateChainFailsWithMissingChain {
 - (void)testDefaultPolicySetToCertificateChainFailsWithMissingChain {
     AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeCertificate];
     AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeCertificate];
-    
+
     // By default the cer files are picked up from the bundle, this forces them to be cleared to emulate having none available
     // By default the cer files are picked up from the bundle, this forces them to be cleared to emulate having none available
     [policy setPinnedCertificates:@[]];
     [policy setPinnedCertificates:@[]];
-    
+
     SecTrustRef trust = AFUTHTTPBinOrgServerTrust();
     SecTrustRef trust = AFUTHTTPBinOrgServerTrust();
     XCTAssert([policy evaluateServerTrust:trust forDomain:nil] == NO, @"Pinning with Certificate Chain Mode and Missing Chain should have failed");
     XCTAssert([policy evaluateServerTrust:trust forDomain:nil] == NO, @"Pinning with Certificate Chain Mode and Missing Chain should have failed");
     CFRelease(trust);
     CFRelease(trust);
@@ -476,10 +476,10 @@ static SecTrustRef AFUTTrustWithCertificate(SecCertificateRef certificate) {
 
 
 - (void)testDefaultPolicySetToPublicKeyChainFailsWithMissingChain {
 - (void)testDefaultPolicySetToPublicKeyChainFailsWithMissingChain {
     AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModePublicKey];
     AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModePublicKey];
-    
+
     // By default the cer files are picked up from the bundle, this forces them to be cleared to emulate having none available
     // By default the cer files are picked up from the bundle, this forces them to be cleared to emulate having none available
     [policy setPinnedCertificates:@[]];
     [policy setPinnedCertificates:@[]];
-    
+
     SecTrustRef trust = AFUTHTTPBinOrgServerTrust();
     SecTrustRef trust = AFUTHTTPBinOrgServerTrust();
     XCTAssert([policy evaluateServerTrust:trust forDomain:nil] == NO, @"Pinning with Public Key Chain Mode and Missing Chain should have failed");
     XCTAssert([policy evaluateServerTrust:trust forDomain:nil] == NO, @"Pinning with Public Key Chain Mode and Missing Chain should have failed");
     CFRelease(trust);
     CFRelease(trust);
@@ -499,13 +499,13 @@ static SecTrustRef AFUTTrustWithCertificate(SecCertificateRef certificate) {
 
 
 - (void)testPolicyWithPinningModeIsSetToNotAllowInvalidSSLCertificates {
 - (void)testPolicyWithPinningModeIsSetToNotAllowInvalidSSLCertificates {
     AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone];
     AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone];
-    
+
     XCTAssert(policy.allowInvalidCertificates == NO, @"policyWithPinningMode: should not allow invalid ssl certificates by default.");
     XCTAssert(policy.allowInvalidCertificates == NO, @"policyWithPinningMode: should not allow invalid ssl certificates by default.");
 }
 }
 
 
 - (void)testPolicyWithPinningModeIsSetToValidatesDomainName {
 - (void)testPolicyWithPinningModeIsSetToValidatesDomainName {
     AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone];
     AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone];
-    
+
     XCTAssert(policy.validatesDomainName == NO, @"policyWithPinningMode: should not allow invalid ssl certificates by default.");
     XCTAssert(policy.validatesDomainName == NO, @"policyWithPinningMode: should not allow invalid ssl certificates by default.");
 }
 }
 
 

+ 1 - 1
Tests/Tests/AFTestCase.h

@@ -1,6 +1,6 @@
 // AFTestCase.h
 // AFTestCase.h
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal

+ 1 - 1
Tests/Tests/AFTestCase.m

@@ -1,6 +1,6 @@
 // AFTestCase.m
 // AFTestCase.m
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal

+ 13 - 13
Tests/Tests/AFURLSessionManagerTests.m

@@ -1,6 +1,6 @@
 // AFNetworkActivityManagerTests.m
 // AFNetworkActivityManagerTests.m
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal
@@ -39,43 +39,43 @@
 
 
 - (void)testUploadTasksProgressBecomesPartOfCurrentProgress {
 - (void)testUploadTasksProgressBecomesPartOfCurrentProgress {
     NSProgress *overallProgress = [NSProgress progressWithTotalUnitCount:100];
     NSProgress *overallProgress = [NSProgress progressWithTotalUnitCount:100];
-    
+
     [overallProgress becomeCurrentWithPendingUnitCount:80];
     [overallProgress becomeCurrentWithPendingUnitCount:80];
     NSProgress *uploadProgress = nil;
     NSProgress *uploadProgress = nil;
-    
+
     [self.manager downloadTaskWithRequest:[NSURLRequest requestWithURL:self.baseURL]
     [self.manager downloadTaskWithRequest:[NSURLRequest requestWithURL:self.baseURL]
                                  progress:&uploadProgress
                                  progress:&uploadProgress
                               destination:nil
                               destination:nil
                         completionHandler:nil];
                         completionHandler:nil];
     [overallProgress resignCurrent];
     [overallProgress resignCurrent];
-    
+
     expect(overallProgress.fractionCompleted).to.equal(0);
     expect(overallProgress.fractionCompleted).to.equal(0);
-    
+
     uploadProgress.totalUnitCount = 1;
     uploadProgress.totalUnitCount = 1;
     uploadProgress.completedUnitCount = 1;
     uploadProgress.completedUnitCount = 1;
-    
-    
+
+
     expect(overallProgress.fractionCompleted).to.equal(0.8);
     expect(overallProgress.fractionCompleted).to.equal(0.8);
 }
 }
 
 
 - (void)testDownloadTasksProgressBecomesPartOfCurrentProgress {
 - (void)testDownloadTasksProgressBecomesPartOfCurrentProgress {
     NSProgress *overallProgress = [NSProgress progressWithTotalUnitCount:100];
     NSProgress *overallProgress = [NSProgress progressWithTotalUnitCount:100];
-    
+
     [overallProgress becomeCurrentWithPendingUnitCount:80];
     [overallProgress becomeCurrentWithPendingUnitCount:80];
     NSProgress *downloadProgress = nil;
     NSProgress *downloadProgress = nil;
-    
+
     [self.manager downloadTaskWithRequest:[NSURLRequest requestWithURL:self.baseURL]
     [self.manager downloadTaskWithRequest:[NSURLRequest requestWithURL:self.baseURL]
                                  progress:&downloadProgress
                                  progress:&downloadProgress
                               destination:nil
                               destination:nil
                         completionHandler:nil];
                         completionHandler:nil];
     [overallProgress resignCurrent];
     [overallProgress resignCurrent];
-    
+
     expect(overallProgress.fractionCompleted).to.equal(0);
     expect(overallProgress.fractionCompleted).to.equal(0);
-    
+
     downloadProgress.totalUnitCount = 1;
     downloadProgress.totalUnitCount = 1;
     downloadProgress.completedUnitCount = 1;
     downloadProgress.completedUnitCount = 1;
-    
-    
+
+
     expect(overallProgress.fractionCompleted).to.equal(0.8);
     expect(overallProgress.fractionCompleted).to.equal(0.8);
 }
 }
 
 

+ 1 - 1
UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h

@@ -1,6 +1,6 @@
 // AFNetworkActivityIndicatorManager.h
 // AFNetworkActivityIndicatorManager.h
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal

+ 4 - 4
UIKit+AFNetworking/AFNetworkActivityIndicatorManager.m

@@ -1,6 +1,6 @@
 // AFNetworkActivityIndicatorManager.m
 // AFNetworkActivityIndicatorManager.m
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal
@@ -121,7 +121,7 @@ static NSURLRequest * AFNetworkRequestFromNotification(NSNotification *notificat
 	@synchronized(self) {
 	@synchronized(self) {
 		_activityCount = activityCount;
 		_activityCount = activityCount;
 	}
 	}
-    
+
     dispatch_async(dispatch_get_main_queue(), ^{
     dispatch_async(dispatch_get_main_queue(), ^{
         [self updateNetworkActivityIndicatorVisibilityDelayed];
         [self updateNetworkActivityIndicatorVisibilityDelayed];
     });
     });
@@ -133,7 +133,7 @@ static NSURLRequest * AFNetworkRequestFromNotification(NSNotification *notificat
 		_activityCount++;
 		_activityCount++;
 	}
 	}
     [self didChangeValueForKey:@"activityCount"];
     [self didChangeValueForKey:@"activityCount"];
-    
+
     dispatch_async(dispatch_get_main_queue(), ^{
     dispatch_async(dispatch_get_main_queue(), ^{
         [self updateNetworkActivityIndicatorVisibilityDelayed];
         [self updateNetworkActivityIndicatorVisibilityDelayed];
     });
     });
@@ -148,7 +148,7 @@ static NSURLRequest * AFNetworkRequestFromNotification(NSNotification *notificat
 #pragma clang diagnostic pop
 #pragma clang diagnostic pop
 	}
 	}
     [self didChangeValueForKey:@"activityCount"];
     [self didChangeValueForKey:@"activityCount"];
-    
+
     dispatch_async(dispatch_get_main_queue(), ^{
     dispatch_async(dispatch_get_main_queue(), ^{
         [self updateNetworkActivityIndicatorVisibilityDelayed];
         [self updateNetworkActivityIndicatorVisibilityDelayed];
     });
     });

+ 2 - 2
UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h

@@ -1,6 +1,6 @@
 // UIActivityIndicatorView+AFNetworking.h
 // UIActivityIndicatorView+AFNetworking.h
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal
@@ -54,7 +54,7 @@
 
 
 /**
 /**
  Binds the animating state to the execution state of the specified operation.
  Binds the animating state to the execution state of the specified operation.
- 
+
  @param operation The operation. If `nil`, automatic updating from any previously specified operation will be disabled.
  @param operation The operation. If `nil`, automatic updating from any previously specified operation will be disabled.
  */
  */
 - (void)setAnimatingWithStateOfOperation:(AFURLConnectionOperation *)operation;
 - (void)setAnimatingWithStateOfOperation:(AFURLConnectionOperation *)operation;

+ 1 - 1
UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m

@@ -1,6 +1,6 @@
 // UIActivityIndicatorView+AFNetworking.m
 // UIActivityIndicatorView+AFNetworking.m
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal

+ 3 - 3
UIKit+AFNetworking/UIAlertView+AFNetworking.h

@@ -1,6 +1,6 @@
 // UIAlertView+AFNetworking.h
 // UIAlertView+AFNetworking.h
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal
@@ -41,7 +41,7 @@
 
 
 /**
 /**
  Shows an alert view with the error of the specified session task, if any.
  Shows an alert view with the error of the specified session task, if any.
- 
+
  @param task The session task.
  @param task The session task.
  @param delegate The alert view delegate.
  @param delegate The alert view delegate.
  */
  */
@@ -52,7 +52,7 @@
 
 
 /**
 /**
  Shows an alert view with the error of the specified session task, if any, with a custom cancel button title and other button titles.
  Shows an alert view with the error of the specified session task, if any, with a custom cancel button title and other button titles.
- 
+
  @param task The session task.
  @param task The session task.
  @param delegate The alert view delegate.
  @param delegate The alert view delegate.
  @param cancelButtonTitle The title of the cancel button or nil if there is no cancel button. Using this argument is equivalent to setting the cancel button index to the value returned by invoking addButtonWithTitle: specifying this title.
  @param cancelButtonTitle The title of the cancel button or nil if there is no cancel button. Using this argument is equivalent to setting the cancel button index to the value returned by invoking addButtonWithTitle: specifying this title.

+ 1 - 1
UIKit+AFNetworking/UIAlertView+AFNetworking.m

@@ -1,6 +1,6 @@
 // UIAlertView+AFNetworking.m
 // UIAlertView+AFNetworking.m
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal

+ 9 - 9
UIKit+AFNetworking/UIButton+AFNetworking.h

@@ -1,6 +1,6 @@
 // UIButton+AFNetworking.h
 // UIButton+AFNetworking.h
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal
@@ -32,7 +32,7 @@
 
 
 /**
 /**
  This category adds methods to the UIKit framework's `UIButton` class. The methods in this category provide support for loading remote images and background images asynchronously from a URL.
  This category adds methods to the UIKit framework's `UIButton` class. The methods in this category provide support for loading remote images and background images asynchronously from a URL.
- 
+
  @warning Compound values for control `state` (such as `UIControlStateHighlighted | UIControlStateDisabled`) are unsupported.
  @warning Compound values for control `state` (such as `UIControlStateHighlighted | UIControlStateDisabled`) are unsupported.
  */
  */
 @interface UIButton (AFNetworking)
 @interface UIButton (AFNetworking)
@@ -70,9 +70,9 @@
 
 
 /**
 /**
  Asynchronously downloads an image from the specified URL, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled.
  Asynchronously downloads an image from the specified URL, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled.
- 
+
   If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
   If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
- 
+
  @param state The control state.
  @param state The control state.
  @param url The URL used for the image request.
  @param url The URL used for the image request.
  */
  */
@@ -81,9 +81,9 @@
 
 
 /**
 /**
  Asynchronously downloads an image from the specified URL, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled.
  Asynchronously downloads an image from the specified URL, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled.
- 
+
  If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
  If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
- 
+
  @param state The control state.
  @param state The control state.
  @param url The URL used for the image request.
  @param url The URL used for the image request.
  @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the button will not change its image until the image request finishes.
  @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the button will not change its image until the image request finishes.
@@ -96,7 +96,7 @@
  Asynchronously downloads an image from the specified URL request, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled.
  Asynchronously downloads an image from the specified URL request, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled.
 
 
  If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
  If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
- 
+
  If a success block is specified, it is the responsibility of the block to set the image of the button before returning. If no success block is specified, the default behavior of setting the image with `setImage:forState:` is applied.
  If a success block is specified, it is the responsibility of the block to set the image of the button before returning. If no success block is specified, the default behavior of setting the image with `setImage:forState:` is applied.
 
 
  @param state The control state.
  @param state The control state.
@@ -164,14 +164,14 @@
 
 
 /**
 /**
  Cancels any executing image operation for the specified control state of the receiver, if one exists.
  Cancels any executing image operation for the specified control state of the receiver, if one exists.
- 
+
  @param state The control state.
  @param state The control state.
  */
  */
 - (void)cancelImageRequestOperationForState:(UIControlState)state;
 - (void)cancelImageRequestOperationForState:(UIControlState)state;
 
 
 /**
 /**
  Cancels any executing background image operation for the specified control state of the receiver, if one exists.
  Cancels any executing background image operation for the specified control state of the receiver, if one exists.
- 
+
  @param state The control state.
  @param state The control state.
  */
  */
 - (void)cancelBackgroundImageRequestOperationForState:(UIControlState)state;
 - (void)cancelBackgroundImageRequestOperationForState:(UIControlState)state;

+ 1 - 1
UIKit+AFNetworking/UIButton+AFNetworking.m

@@ -1,6 +1,6 @@
 // UIButton+AFNetworking.m
 // UIButton+AFNetworking.m
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal

+ 13 - 13
UIKit+AFNetworking/UIImageView+AFNetworking.h

@@ -1,6 +1,6 @@
 // UIImageView+AFNetworking.h
 // UIImageView+AFNetworking.h
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal
@@ -46,7 +46,7 @@
 
 
 /**
 /**
  Set the cache used for image loading.
  Set the cache used for image loading.
- 
+
  @param imageCache The image cache.
  @param imageCache The image cache.
  */
  */
 + (void)setSharedImageCache:(id <AFImageCache>)imageCache;
 + (void)setSharedImageCache:(id <AFImageCache>)imageCache;
@@ -57,7 +57,7 @@
 
 
 /**
 /**
  The response serializer used to create an image representation from the server response and response data. By default, this is an instance of `AFImageResponseSerializer`.
  The response serializer used to create an image representation from the server response and response data. By default, this is an instance of `AFImageResponseSerializer`.
- 
+
  @discussion Subclasses of `AFImageResponseSerializer` could be used to perform post-processing, such as color correction, face detection, or other effects. See https://github.com/AFNetworking/AFCoreImageSerializer
  @discussion Subclasses of `AFImageResponseSerializer` could be used to perform post-processing, such as color correction, face detection, or other effects. See https://github.com/AFNetworking/AFCoreImageSerializer
  */
  */
 @property (nonatomic, strong) id <AFURLResponseSerialization> imageResponseSerializer;
 @property (nonatomic, strong) id <AFURLResponseSerialization> imageResponseSerializer;
@@ -67,8 +67,8 @@
 ///--------------------
 ///--------------------
 
 
 /**
 /**
- Asynchronously downloads an image from the specified URL, and sets it once the request is finished. Any previous image request for the receiver will be cancelled. 
- 
+ Asynchronously downloads an image from the specified URL, and sets it once the request is finished. Any previous image request for the receiver will be cancelled.
+
  If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
  If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
 
 
  By default, URL requests have a `Accept` header field value of "image / *", a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set not handle cookies. To configure URL requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:`
  By default, URL requests have a `Accept` header field value of "image / *", a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set not handle cookies. To configure URL requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:`
@@ -78,8 +78,8 @@
 - (void)setImageWithURL:(NSURL *)url;
 - (void)setImageWithURL:(NSURL *)url;
 
 
 /**
 /**
- Asynchronously downloads an image from the specified URL, and sets it once the request is finished. Any previous image request for the receiver will be cancelled. 
- 
+ Asynchronously downloads an image from the specified URL, and sets it once the request is finished. Any previous image request for the receiver will be cancelled.
+
  If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
  If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
 
 
  By default, URL requests have a `Accept` header field value of "image / *", a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set not handle cookies. To configure URL requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:`
  By default, URL requests have a `Accept` header field value of "image / *", a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set not handle cookies. To configure URL requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:`
@@ -91,10 +91,10 @@
        placeholderImage:(UIImage *)placeholderImage;
        placeholderImage:(UIImage *)placeholderImage;
 
 
 /**
 /**
- Asynchronously downloads an image from the specified URL request, and sets it once the request is finished. Any previous image request for the receiver will be cancelled. 
- 
+ Asynchronously downloads an image from the specified URL request, and sets it once the request is finished. Any previous image request for the receiver will be cancelled.
+
  If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
  If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
- 
+
  If a success block is specified, it is the responsibility of the block to set the image of the image view before returning. If no success block is specified, the default behavior of setting the image with `self.image = image` is applied.
  If a success block is specified, it is the responsibility of the block to set the image of the image view before returning. If no success block is specified, the default behavior of setting the image with `self.image = image` is applied.
 
 
  @param urlRequest The URL request used for the image request.
  @param urlRequest The URL request used for the image request.
@@ -123,16 +123,16 @@
 
 
 /**
 /**
  Returns a cached image for the specififed request, if available.
  Returns a cached image for the specififed request, if available.
- 
+
  @param request The image request.
  @param request The image request.
- 
+
  @return The cached image.
  @return The cached image.
  */
  */
 - (UIImage *)cachedImageForRequest:(NSURLRequest *)request;
 - (UIImage *)cachedImageForRequest:(NSURLRequest *)request;
 
 
 /**
 /**
  Caches a particular image for the specified request.
  Caches a particular image for the specified request.
- 
+
  @param image The image to cache.
  @param image The image to cache.
  @param request The request to be used as a cache key.
  @param request The request to be used as a cache key.
  */
  */

+ 2 - 2
UIKit+AFNetworking/UIImageView+AFNetworking.m

@@ -1,6 +1,6 @@
 // UIImageView+AFNetworking.m
 // UIImageView+AFNetworking.m
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal
@@ -140,7 +140,7 @@
         if (placeholderImage) {
         if (placeholderImage) {
             self.image = placeholderImage;
             self.image = placeholderImage;
         }
         }
-        
+
         __weak __typeof(self)weakSelf = self;
         __weak __typeof(self)weakSelf = self;
         self.af_imageRequestOperation = [[AFHTTPRequestOperation alloc] initWithRequest:urlRequest];
         self.af_imageRequestOperation = [[AFHTTPRequestOperation alloc] initWithRequest:urlRequest];
         self.af_imageRequestOperation.responseSerializer = self.imageResponseSerializer;
         self.af_imageRequestOperation.responseSerializer = self.imageResponseSerializer;

+ 2 - 2
UIKit+AFNetworking/UIProgressView+AFNetworking.h

@@ -1,6 +1,6 @@
 // UIProgressView+AFNetworking.h
 // UIProgressView+AFNetworking.h
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal
@@ -41,7 +41,7 @@
 
 
 /**
 /**
  Binds the progress to the upload progress of the specified session task.
  Binds the progress to the upload progress of the specified session task.
- 
+
  @param task The session task.
  @param task The session task.
  @param animated `YES` if the change should be animated, `NO` if the change should happen immediately.
  @param animated `YES` if the change should be animated, `NO` if the change should happen immediately.
  */
  */

+ 1 - 1
UIKit+AFNetworking/UIProgressView+AFNetworking.m

@@ -1,6 +1,6 @@
 // UIProgressView+AFNetworking.m
 // UIProgressView+AFNetworking.m
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal

+ 3 - 3
UIKit+AFNetworking/UIWebView+AFNetworking.h

@@ -1,6 +1,6 @@
 // UIWebView+AFNetworking.h
 // UIWebView+AFNetworking.h
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal
@@ -33,7 +33,7 @@
 
 
 /**
 /**
  This category adds methods to the UIKit framework's `UIWebView` class. The methods in this category provide increased control over the request cycle, including progress monitoring and success / failure handling.
  This category adds methods to the UIKit framework's `UIWebView` class. The methods in this category provide increased control over the request cycle, including progress monitoring and success / failure handling.
- 
+
  @discussion When using these category methods, make sure to assign `delegate` for the web view, which implements `–webView:shouldStartLoadWithRequest:navigationType:` appropriately. This allows for tapped links to be loaded through AFNetworking, and can ensure that `canGoBack` & `canGoForward` update their values correctly.
  @discussion When using these category methods, make sure to assign `delegate` for the web view, which implements `–webView:shouldStartLoadWithRequest:navigationType:` appropriately. This allows for tapped links to be loaded through AFNetworking, and can ensure that `canGoBack` & `canGoForward` update their values correctly.
  */
  */
 @interface UIWebView (AFNetworking)
 @interface UIWebView (AFNetworking)
@@ -50,7 +50,7 @@
 
 
 /**
 /**
  Asynchronously loads the specified request.
  Asynchronously loads the specified request.
- 
+
  @param request A URL request identifying the location of the content to load. This must not be `nil`.
  @param request A URL request identifying the location of the content to load. This must not be `nil`.
  @param progress A block object to be called when an undetermined number of bytes have been downloaded from the server. This block has no return value and takes three arguments: the number of bytes read since the last time the download progress block was called, the total bytes read, and the total bytes expected to be read during the request, as initially determined by the expected content size of the `NSHTTPURLResponse` object. This block may be called multiple times, and will execute on the main thread.
  @param progress A block object to be called when an undetermined number of bytes have been downloaded from the server. This block has no return value and takes three arguments: the number of bytes read since the last time the download progress block was called, the total bytes read, and the total bytes expected to be read during the request, as initially determined by the expected content size of the `NSHTTPURLResponse` object. This block may be called multiple times, and will execute on the main thread.
  @param success A block object to be executed when the request finishes loading successfully. This block returns the HTML string to be loaded by the web view, and takes two arguments: the response, and the response string.
  @param success A block object to be executed when the request finishes loading successfully. This block returns the HTML string to be loaded by the web view, and takes two arguments: the response, and the response string.

+ 1 - 1
UIKit+AFNetworking/UIWebView+AFNetworking.m

@@ -1,6 +1,6 @@
 // UIWebView+AFNetworking.m
 // UIWebView+AFNetworking.m
 //
 //
-// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+// Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // of this software and associated documentation files (the "Software"), to deal