Jelajahi Sumber

Updating copyright year

Mattt Thompson 10 tahun lalu
induk
melakukan
011dc783e9
51 mengubah file dengan 396 tambahan dan 396 penghapusan
  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
 //
-// 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
 // of this software and associated documentation files (the "Software"), to deal

+ 10 - 10
AFNetworking/AFHTTPRequestOperationManager.h

@@ -1,6 +1,6 @@
 // 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
 // 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.
 
  ## 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.
- 
+
  For developers targeting iOS 6 or Mac OS X 10.8 or earlier, `AFHTTPRequestOperationManager` may be used to similar effect.
- 
+
  ## Methods to Override
 
  To change the behavior of all request operation construction for an `AFHTTPRequestOperationManager` subclass, override `HTTPRequestOperationWithRequest:success:failure`.
 
  ## 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>`
 
  ## 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.
- 
+
  @warning `requestSerializer` must not be `nil`.
  */
 @property (nonatomic, strong) AFHTTPRequestSerializer <AFURLRequestSerialization> * requestSerializer;
@@ -169,9 +169,9 @@
 
 /**
  Initializes an `AFHTTPRequestOperationManager` object with the specified base URL.
- 
+
  This is the designated initializer.
- 
+
  @param url The base URL for the HTTP client.
 
  @return The newly-initialized HTTP client

+ 3 - 3
AFNetworking/AFHTTPRequestOperationManager.m

@@ -1,6 +1,6 @@
 // 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
 // of this software and associated documentation files (the "Software"), to deal
@@ -43,7 +43,7 @@
 }
 
 - (instancetype)init {
-    return [self initWithBaseURL:nil];    
+    return [self initWithBaseURL:nil];
 }
 
 - (instancetype)initWithBaseURL:(NSURL *)url {
@@ -278,7 +278,7 @@
 
     HTTPClient.requestSerializer = [self.requestSerializer copyWithZone:zone];
     HTTPClient.responseSerializer = [self.responseSerializer copyWithZone:zone];
-    
+
     return HTTPClient;
 }
 

+ 1 - 1
AFNetworking/AFHTTPSessionManager.h

@@ -1,6 +1,6 @@
 // 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
 // of this software and associated documentation files (the "Software"), to deal

+ 2 - 2
AFNetworking/AFHTTPSessionManager.m

@@ -1,6 +1,6 @@
 // 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
 // of this software and associated documentation files (the "Software"), to deal
@@ -312,7 +312,7 @@
 
     HTTPClient.requestSerializer = [self.requestSerializer copyWithZone:zone];
     HTTPClient.responseSerializer = [self.responseSerializer copyWithZone:zone];
-    
+
     return HTTPClient;
 }
 

+ 10 - 10
AFNetworking/AFNetworkReachabilityManager.h

@@ -1,6 +1,6 @@
 // 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
 // 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
 // copies of the Software, and to permit persons to whom the Software is
 // furnished to do so, subject to the following conditions:
-// 
+//
 // The above copyright notice and this permission notice shall be included in
 // all copies or substantial portions of the Software.
-// 
+//
 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 // 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.
- 
+
  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/)
- 
+
  @warning Instances of `AFNetworkReachabilityManager` must be started with `-startMonitoring` before reachability status can be determined.
  */
 @interface AFNetworkReachabilityManager : NSObject
@@ -72,9 +72,9 @@ typedef NS_ENUM(NSInteger, AFNetworkReachabilityStatus) {
 
 /**
  Creates and returns a network reachability manager for the specified domain.
- 
+
  @param domain The domain used to evaluate network reachability.
- 
+
  @return An initialized network reachability manager, actively monitoring the specified 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.
- 
+
  @param reachability The reachability object to monitor.
- 
+
  @return An initialized network reachability manager, actively monitoring the specified reachability.
  */
 - (instancetype)initWithReachability:(SCNetworkReachabilityRef)reachability NS_DESIGNATED_INITIALIZER;

+ 7 - 7
AFNetworking/AFNetworkReachabilityManager.m

@@ -1,6 +1,6 @@
 // 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
 // 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
 // copies of the Software, and to permit persons to whom the Software is
 // furnished to do so, subject to the following conditions:
-// 
+//
 // The above copyright notice and this permission notice shall be included in
 // all copies or substantial portions of the Software.
-// 
+//
 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 // 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];
         [notificationCenter postNotificationName:AFNetworkingReachabilityDidChangeNotification object:nil userInfo:@{ AFNetworkingReachabilityNotificationStatusItem: @(status) }];
     });
-    
+
 }
 
 static const void * AFNetworkReachabilityRetainCallback(const void *info) {
@@ -214,11 +214,11 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
                 AFNetworkReachabilityStatus status = AFNetworkReachabilityStatusForFlags(flags);
                 dispatch_async(dispatch_get_main_queue(), ^{
                     callback(status);
-                    
+
                     NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
                     [notificationCenter postNotificationName:AFNetworkingReachabilityDidChangeNotification object:nil userInfo:@{ AFNetworkingReachabilityNotificationStatusItem: @(status) }];
 
-                    
+
                 });
             });
         }

+ 9 - 9
AFNetworking/AFSecurityPolicy.h

@@ -1,6 +1,6 @@
 // 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
 // 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.
- 
+
  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
@@ -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.
- 
+
  @return The default security policy.
  */
 + (instancetype)defaultPolicy;
@@ -80,7 +80,7 @@ typedef NS_ENUM(NSUInteger, AFSSLPinningMode) {
  Creates and returns a security policy with the specified pinning mode.
 
  @param pinningMode The SSL pinning mode.
- 
+
  @return A new security policy.
  */
 + (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode;
@@ -97,19 +97,19 @@ typedef NS_ENUM(NSUInteger, AFSSLPinningMode) {
  @param serverTrust The X.509 certificate trust of the server.
 
  @return Whether or not to trust the server.
- 
+
  @warning This method has been deprecated in favor of `-evaluateServerTrust:forDomain:`.
  */
 - (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.
- 
+
  @param serverTrust The X.509 certificate trust of the server.
  @param domain The domain of serverTrust. If `nil`, the domain will not be validated.
- 
+
  @return Whether or not to trust the server.
  */
 - (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust

+ 3 - 3
AFNetworking/AFSecurityPolicy.m

@@ -1,6 +1,6 @@
 // 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
 // of this software and associated documentation files (the "Software"), to deal
@@ -125,7 +125,7 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) {
 
         SecTrustRef trust;
         __Require_noErr_Quiet(SecTrustCreateWithCertificates(certificates, policy, &trust), _out);
-        
+
         SecTrustResultType result;
         __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 NO;
 }
 

+ 11 - 11
AFNetworking/AFURLConnectionOperation.h

@@ -1,6 +1,6 @@
 // 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
 // of this software and associated documentation files (the "Software"), to deal
@@ -47,7 +47,7 @@
  - `connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:`
  - `connection:willCacheResponse:`
  - `connectionShouldUseCredentialStorage:`
- - `connection:needNewBodyStream:` 
+ - `connection:needNewBodyStream:`
  - `connection:willSendRequestForAuthenticationChallenge:`
 
  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.
 
  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
- 
+
  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.
 
  Connections will be validated on all matching certificates with a `.cer` extension in the bundle root.
- 
+
  ## App Extensions
- 
+
  When using AFNetworking in an App Extension, `#define AF_APP_EXTENSIONS` to avoid using unavailable APIs.
 
  ## 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.
- 
+
  This is the designated initializer.
- 
+
  @param urlRequest The request object to be used by the operation connection.
  */
 - (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:`.
- 
+
  @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.
  */
 - (void)setWillSendRequestForAuthenticationChallengeBlock:(void (^)(NSURLConnection *connection, NSURLAuthenticationChallenge *challenge))block;

+ 29 - 29
AFNetworking/AFURLConnectionOperation.m

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

+ 13 - 13
AFNetworking/AFURLRequestSerialization.h

@@ -1,6 +1,6 @@
 // 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
 // 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
 // copies of the Software, and to permit persons to whom the Software is
 // furnished to do so, subject to the following conditions:
-// 
+//
 // The above copyright notice and this permission notice shall be included in
 // all copies or substantial portions of the Software.
-// 
+//
 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 // 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.
- 
+
  @see NSMutableURLRequest -setAllowsCellularAccess:
  */
 @property (nonatomic, assign) BOOL allowsCellularAccess;
 
 /**
  The cache policy of created requests. `NSURLRequestUseProtocolCachePolicy` by default.
- 
+
  @see NSMutableURLRequest -setCachePolicy:
  */
 @property (nonatomic, assign) NSURLRequestCachePolicy cachePolicy;
 
 /**
  Whether created requests should use the default cookie handling. `YES` by default.
- 
+
  @see NSMutableURLRequest -setHTTPShouldHandleCookies:
  */
 @property (nonatomic, assign) BOOL HTTPShouldHandleCookies;
 
 /**
  Whether created requests can continue transmitting data before receiving a response from an earlier transmission. `NO` by default
- 
+
  @see NSMutableURLRequest -setHTTPShouldUsePipelining:
  */
 @property (nonatomic, assign) BOOL HTTPShouldUsePipelining;
 
 /**
  The network service type for created requests. `NSURLNetworkServiceTypeDefault` by default.
- 
+
  @see NSMutableURLRequest -setNetworkServiceType:
  */
 @property (nonatomic, assign) NSURLRequestNetworkServiceType networkServiceType;
 
 /**
  The timeout interval, in seconds, for created requests. The default timeout interval is 60 seconds.
- 
+
  @see NSMutableURLRequest -setTimeoutInterval:
  */
 @property (nonatomic, assign) NSTimeInterval timeoutInterval;
@@ -139,7 +139,7 @@ forHTTPHeaderField:(NSString *)field;
  Returns the value for the HTTP headers set in the request serializer.
 
  @param field The HTTP header to retrieve the default value for
- 
+
  @return The value set as default for the specified header, or `nil`
  */
 - (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.
- 
+
  @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 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.
 
  @see https://github.com/AFNetworking/AFNetworking/issues/1398
@@ -404,7 +404,7 @@ forHTTPHeaderField:(NSString *)field;
 
  @param format The property list format.
  @param writeOptions The property list write options.
- 
+
  @warning The `writeOptions` property is currently unused.
  */
 + (instancetype)serializerWithFormat:(NSPropertyListFormat)format

+ 10 - 10
AFNetworking/AFURLRequestSerialization.m

@@ -1,6 +1,6 @@
 // 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
 // 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
 // copies of the Software, and to permit persons to whom the Software is
 // furnished to do so, subject to the following conditions:
-// 
+//
 // The above copyright notice and this permission notice shall be included in
 // all copies or substantial portions of the Software.
-// 
+//
 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -154,7 +154,7 @@ NSArray * AFQueryStringPairsFromKeyAndValue(NSString *key, id value) {
     } else {
         [mutableQueryStringComponents addObject:[[AFQueryStringPair alloc] initWithField:key value:value]];
     }
-    
+
     return mutableQueryStringComponents;
 }
 
@@ -526,7 +526,7 @@ forHTTPHeaderField:(NSString *)field
     serializer.mutableHTTPRequestHeaders = [self.mutableHTTPRequestHeaders mutableCopyWithZone:zone];
     serializer.queryStringSerializationStyle = self.queryStringSerializationStyle;
     serializer.queryStringSerialization = self.queryStringSerialization;
-    
+
     return serializer;
 }
 
@@ -671,11 +671,11 @@ NSTimeInterval const kAFUploadStream3GSuggestedDelay = 0.2;
     if (!fileAttributes) {
         return NO;
     }
-    
+
     NSMutableDictionary *mutableHeaders = [NSMutableDictionary dictionary];
     [mutableHeaders setValue:[NSString stringWithFormat:@"form-data; name=\"%@\"; filename=\"%@\"", name, fileName] forKey:@"Content-Disposition"];
     [mutableHeaders setValue:mimeType forKey:@"Content-Type"];
-    
+
     AFHTTPBodyPart *bodyPart = [[AFHTTPBodyPart alloc] init];
     bodyPart.stringEncoding = self.stringEncoding;
     bodyPart.headers = mutableHeaders;
@@ -1164,13 +1164,13 @@ typedef enum {
 
 - (id)copyWithZone:(NSZone *)zone {
     AFHTTPBodyPart *bodyPart = [[[self class] allocWithZone:zone] init];
-    
+
     bodyPart.stringEncoding = self.stringEncoding;
     bodyPart.headers = self.headers;
     bodyPart.bodyContentLength = self.bodyContentLength;
     bodyPart.body = self.body;
     bodyPart.boundary = self.boundary;
-    
+
     return bodyPart;
 }
 
@@ -1211,7 +1211,7 @@ typedef enum {
             [mutableRequest setValue:value forHTTPHeaderField:field];
         }
     }];
-    
+
     if (parameters) {
         if (![mutableRequest valueForHTTPHeaderField:@"Content-Type"]) {
             [mutableRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];

+ 4 - 4
AFNetworking/AFURLResponseSerialization.h

@@ -1,6 +1,6 @@
 // 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
 // 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
 // copies of the Software, and to permit persons to whom the Software is
 // furnished to do so, subject to the following conditions:
-// 
+//
 // The above copyright notice and this permission notice shall be included in
 // all copies or substantial portions of the Software.
-// 
+//
 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -299,7 +299,7 @@ extern NSString * const AFURLResponseSerializationErrorDomain;
 
  `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`.
- 
+
  `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`.
  */

+ 7 - 7
AFNetworking/AFURLResponseSerialization.m

@@ -1,6 +1,6 @@
 // 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
 // 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
 // copies of the Software, and to permit persons to whom the Software is
 // furnished to do so, subject to the following conditions:
-// 
+//
 // The above copyright notice and this permission notice shall be included in
 // all copies or substantial portions of the Software.
-// 
+//
 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 // 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) {
         responseObject = AFJSONObjectByRemovingKeysWithNullValues(responseObject, self.readingOptions);
     }
-    
+
     if (error) {
         *error = AFErrorWithUnderlyingError(serializationError, *error);
     }
-    
+
     return responseObject;
 }
 
@@ -622,7 +622,7 @@ static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *r
 
     CGImageRelease(inflatedImageRef);
     CGImageRelease(imageRef);
-    
+
     return inflatedImage;
 }
 #endif
@@ -758,7 +758,7 @@ static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *r
             return responseObject;
         }
     }
-    
+
     return [super responseObjectForResponse:response data:data error:error];
 }
 

+ 1 - 1
AFNetworking/AFURLSessionManager.h

@@ -1,6 +1,6 @@
 // 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
 // of this software and associated documentation files (the "Software"), to deal

+ 12 - 12
AFNetworking/AFURLSessionManager.m

@@ -1,6 +1,6 @@
 // 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
 // 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
 // copies of the Software, and to permit persons to whom the Software is
 // furnished to do so, subject to the following conditions:
-// 
+//
 // The above copyright notice and this permission notice shall be included in
 // all copies or substantial portions of the Software.
-// 
+//
 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -194,7 +194,7 @@ didCompleteWithError:(NSError *)error
                 if (self.completionHandler) {
                     self.completionHandler(task.response, responseObject, serializationError);
                 }
-                
+
                 dispatch_async(dispatch_get_main_queue(), ^{
                     [[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.name = AFURLSessionManagerLockName;
-    
+
     [self.session getTasksWithCompletionHandler:^(NSArray *dataTasks, NSArray *uploadTasks, NSArray *downloadTasks) {
         for (NSURLSessionDataTask *task in dataTasks) {
             [self addDelegateForDataTask:task completionHandler:nil];
         }
-        
+
         for (NSURLSessionUploadTask *uploadTask in uploadTasks) {
             [self addDelegateForUploadTask:uploadTask progress:nil completionHandler:nil];
         }
-        
+
         for (NSURLSessionDownloadTask *downloadTask in downloadTasks) {
             [self addDelegateForDownloadTask:downloadTask progress:nil destination:nil completionHandler:nil];
         }
@@ -876,7 +876,7 @@ didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge
  needNewBodyStream:(void (^)(NSInputStream *bodyStream))completionHandler
 {
     NSInputStream *inputStream = nil;
-    
+
     if (self.taskNeedNewBodyStream) {
         inputStream = self.taskNeedNewBodyStream(session, task);
     } else if (task.originalRequest.HTTPBodyStream && [task.originalRequest.HTTPBodyStream conformsToProtocol:@protocol(NSCopying)]) {
@@ -894,7 +894,7 @@ didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge
     totalBytesSent:(int64_t)totalBytesSent
 totalBytesExpectedToSend:(int64_t)totalBytesExpectedToSend
 {
-    
+
     int64_t totalUnitCount = totalBytesExpectedToSend;
     if(totalUnitCount == NSURLSessionTransferSizeUnknown) {
         NSString *contentLength = [task.originalRequest valueForHTTPHeaderField:@"Content-Length"];
@@ -902,7 +902,7 @@ totalBytesExpectedToSend:(int64_t)totalBytesExpectedToSend
             totalUnitCount = (int64_t) [contentLength longLongValue];
         }
     }
-    
+
     AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:task];
     [delegate URLSession:session task:task didSendBodyData:bytesSent totalBytesSent:totalBytesSent totalBytesExpectedToSend:totalUnitCount];
 
@@ -1019,7 +1019,7 @@ didFinishDownloadingToURL:(NSURL *)location
             return;
         }
     }
-    
+
     if (delegate) {
         [delegate URLSession:session downloadTask:downloadTask didFinishDownloadingToURL:location];
     }

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

@@ -1,6 +1,6 @@
 // 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
 // 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
 //
-// 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
 // of this software and associated documentation files (the "Software"), to deal
@@ -76,7 +76,7 @@
 
 - (void)testThatCancellationOfRequestOperationInvokesFailureCompletionBlock {
     __block NSError *blockError = nil;
-    
+
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/5" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
     [operation setCompletionBlockWithSuccess:nil failure:^(AFHTTPRequestOperation *operation, NSError *error) {
@@ -100,7 +100,7 @@
     [operation setCompletionBlockWithSuccess:nil failure:^(AFHTTPRequestOperation *operation, NSError *error) {
         blockError = error;
     }];
-    
+
     [operation start];
     expect([operation isFinished]).will.beTruthy();
     expect(blockError).willNot.beNil();
@@ -108,7 +108,7 @@
 
 - (void)testThatRedirectBlockIsCalledWhen302IsEncountered {
     __block BOOL success;
-    
+
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/redirect/1" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
     [operation setCompletionBlockWithSuccess:nil failure:nil];
@@ -119,7 +119,7 @@
 
         return request;
     }];
-    
+
     [operation start];
     expect([operation isFinished]).will.beTruthy();
     expect(success).will.beTruthy();
@@ -128,7 +128,7 @@
 - (void)testThatRedirectBlockIsCalledMultipleTimesWhenMultiple302sAreEncountered {
     [Expecta setAsynchronousTestTimeout:5.0];
     __block NSInteger numberOfRedirects = 0;
-    
+
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/redirect/5" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
     [operation setCompletionBlockWithSuccess:nil failure:nil];
@@ -136,7 +136,7 @@
         if(redirectResponse){
             numberOfRedirects++;
         }
-        
+
         return request;
     }];
 
@@ -151,10 +151,10 @@
     [Expecta setAsynchronousTestTimeout:3.0];
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/1" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
-    
+
     [operation start];
     expect([operation isExecuting]).will.beTruthy();
-    
+
     [operation pause];
     expect([operation isPaused]).will.beTruthy();
     [operation cancel];
@@ -164,10 +164,10 @@
     [Expecta setAsynchronousTestTimeout:3.0];
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/1" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
-    
+
     [operation start];
     expect([operation isExecuting]).will.beTruthy();
-    
+
     [operation pause];
     expect([operation isPaused]).will.beTruthy();
 
@@ -179,9 +179,9 @@
 
 - (void)testThatPausedOperationCanBeCompleted {
     [Expecta setAsynchronousTestTimeout:3.0];
-    
+
     __block id blockResponseObject = nil;
-    
+
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/1" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
     [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
@@ -190,10 +190,10 @@
 
     [operation start];
     expect([operation isExecuting]).will.beTruthy();
-    
+
     [operation pause];
     expect([operation isPaused]).will.beTruthy();
-    
+
     [operation resume];
     expect([operation isExecuting]).will.beTruthy();
     expect([operation isFinished]).will.beTruthy();

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

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

+ 54 - 54
Tests/Tests/AFHTTPRequestOperationTests.m

@@ -1,6 +1,6 @@
 // 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
 // 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.
 - (void)testPauseResumeStallsNetworkThread {
     [Expecta setAsynchronousTestTimeout:5.0];
-    
+
     __block id blockResponseObject = nil;
     __block id blockError = nil;
-    
+
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/1" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
     [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
@@ -46,7 +46,7 @@
     } failure:^(AFHTTPRequestOperation *operation, NSError *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'.
     // 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 pause];
     expect([operation isPaused]).will.beTruthy();
-    
+
     // Resume the operation.
     [operation resume];
     expect([operation isExecuting]).will.beTruthy();
     expect([operation isFinished]).will.beTruthy();
     expect(blockError).will.beNil();
     expect(blockResponseObject).willNot.beNil();
-    
+
     // The first operation completed, but the network thread is now in an infinite loop.
     // Future requests should not work.
     blockResponseObject = nil;
@@ -73,7 +73,7 @@
     } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
         blockError = error;
     }];
-    
+
     // The network thread is stalled, so this operation could not succeed.
     [operation2 start];
     expect(blockError).will.beNil();
@@ -83,16 +83,16 @@
 - (void)testThatOperationInvokesSuccessCompletionBlockWithResponseObjectOnSuccess {
     __block id blockResponseObject = nil;
     __block id blockError = nil;
-    
+
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/get" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
-    
+
     [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
         blockResponseObject = responseObject;
     } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
         blockError = error;
     }];
-    
+
     [operation start];
 
     expect([operation isFinished]).will.beTruthy();
@@ -122,14 +122,14 @@
 
 - (void)testThatOperationInvokesFailureCompletionBlockWithErrorOnFailure {
     __block NSError *blockError = nil;
-    
+
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/status/404" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
-    
+
     [operation setCompletionBlockWithSuccess:nil failure:^(AFHTTPRequestOperation *operation, NSError *error) {
         blockError = error;
     }];
-    
+
     [operation start];
     expect([operation isFinished]).will.beTruthy();
     expect(blockError).willNot.beNil();
@@ -138,10 +138,10 @@
 - (void)testThatCancellationOfRequestOperationSetsError {
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/5" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
-    
+
     [operation start];
     expect([operation isExecuting]).will.beTruthy();
-    
+
     [operation cancel];
     expect(operation.error).willNot.beNil();
     expect(operation.error.code).to.equal(NSURLErrorCancelled);
@@ -149,17 +149,17 @@
 
 - (void)testThatCancellationOfRequestOperationInvokesFailureCompletionBlock {
     __block NSError *blockError = nil;
-    
+
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/5" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
-    
+
     [operation setCompletionBlockWithSuccess:nil failure:^(AFHTTPRequestOperation *operation, NSError *error) {
         blockError = error;
     }];
-    
+
     [operation start];
     expect([operation isExecuting]).will.beTruthy();
-    
+
     [operation cancel];
     expect(operation.error).willNot.beNil();
     expect(blockError).willNot.beNil();
@@ -168,21 +168,21 @@
 
 - (void)testThatCancellationOfRequestBeforeStartingRequestSetsError {
     __block NSError *blockError = nil;
-    
+
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/5" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
-    
+
     [operation setCompletionBlockWithSuccess:nil failure:^(AFHTTPRequestOperation *operation, NSError *error) {
         blockError = error;
     }];
-    
+
     [operation cancel];
     [operation start];
-    
+
     expect([operation isCancelled]).will.beTruthy();
     expect([operation isFinished]).will.beTruthy();
     expect([operation isExecuting]).will.beFalsy();
-    
+
     expect(operation.error).willNot.beNil();
     expect(blockError).willNot.beNil();
     expect(blockError.code).will.equal(NSURLErrorCancelled);
@@ -190,17 +190,17 @@
 
 - (void)testThatCancellationOfRequestBeforeStartingRequestSetsErrorInvokesFailureCompletionBlock {
     __block NSError *blockError = nil;
-    
+
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/5" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
 
     [operation setCompletionBlockWithSuccess:nil failure:^(AFHTTPRequestOperation *operation, NSError *error) {
         blockError = error;
     }];
-    
+
     [operation cancel];
     [operation start];
-    
+
     expect(operation.error).willNot.beNil();
     expect(blockError).willNot.beNil();
     expect(blockError.code).will.equal(NSURLErrorCancelled);
@@ -208,14 +208,14 @@
 
 - (void)testThat500StatusCodeInvokesFailureCompletionBlockWithErrorOnFailure {
     __block NSError *blockError = nil;
-    
+
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/status/500" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
 
     [operation setCompletionBlockWithSuccess:nil failure:^(AFHTTPRequestOperation *operation, NSError *error) {
         blockError = error;
     }];
-    
+
     [operation start];
     expect([operation isFinished]).will.beTruthy();
     expect(blockError).willNot.beNil();
@@ -224,7 +224,7 @@
 - (void)testThatRedirectBlockIsCalledWhen302IsEncountered {
     __block BOOL success;
     __block NSError *blockError = nil;
-    
+
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/redirect/1" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
 
@@ -235,10 +235,10 @@
         if(redirectResponse){
             success = YES;
         }
-        
+
         return request;
     }];
-    
+
     [operation start];
     expect([operation isFinished]).will.beTruthy();
     expect(blockError).will.beNil();
@@ -249,7 +249,7 @@
     [Expecta setAsynchronousTestTimeout:5.0];
     __block NSInteger numberOfRedirects = 0;
     __block NSError *blockError = nil;
-    
+
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/redirect/5" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
 
@@ -260,10 +260,10 @@
         if(redirectResponse){
             numberOfRedirects++;
         }
-        
+
         return request;
     }];
-    
+
     [operation start];
     expect([operation isFinished]).will.beTruthy();
     expect(blockError).will.beNil();
@@ -276,10 +276,10 @@
     [Expecta setAsynchronousTestTimeout:3.0];
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/1" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
-    
+
     [operation start];
     expect([operation isExecuting]).will.beTruthy();
-    
+
     [operation pause];
     expect([operation isPaused]).will.beTruthy();
     [operation cancel];
@@ -292,22 +292,22 @@
 
     [operation start];
     expect([operation isExecuting]).will.beTruthy();
-    
+
     [operation pause];
     expect([operation isPaused]).will.beTruthy();
-    
+
     [operation resume];
     expect([operation isExecuting]).will.beTruthy();
-    
+
     [operation cancel];
 }
 
 - (void)testThatPausedOperationCanBeCompleted {
     [Expecta setAsynchronousTestTimeout:3.0];
-    
+
     __block id blockResponseObject = nil;
     __block id blockError = nil;
-    
+
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/1" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
     [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
@@ -315,13 +315,13 @@
     } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
         blockError = error;
     }];
-    
+
     [operation start];
     expect([operation isExecuting]).will.beTruthy();
-    
+
     [operation pause];
     expect([operation isPaused]).will.beTruthy();
-    
+
     [operation resume];
     expect([operation isExecuting]).will.beTruthy();
     expect([operation isFinished]).will.beTruthy();
@@ -332,25 +332,25 @@
 - (void)testThatOperationPostsDidStartNotificationWhenStarted {
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/get" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
-    
+
     __block BOOL notificationFound;
-    
+
     id observer = [[NSNotificationCenter defaultCenter] addObserverForName:AFNetworkingOperationDidStartNotification object:nil queue:nil usingBlock:^(NSNotification *note) {
         if([[[note object] request] isEqual:operation.request]){
             notificationFound = YES;
         }
     }];
-    
+
     [operation start];
     expect(notificationFound).will.beTruthy();
-    
+
     [[NSNotificationCenter defaultCenter] removeObserver:observer];
 }
 
 - (void)testThatOperationPostsDidFinishNotificationWhenFinished {
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/get" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
-    
+
     __block BOOL notificationFound;
 
     id observer = [[NSNotificationCenter defaultCenter] addObserverForName:AFNetworkingOperationDidFinishNotification object:nil queue:nil usingBlock:^(NSNotification *note) {
@@ -358,10 +358,10 @@
             notificationFound = YES;
         }
     }];
-    
+
     [operation start];
     expect(notificationFound).will.beTruthy();
-    
+
     [[NSNotificationCenter defaultCenter] removeObserver:observer];
 }
 
@@ -379,7 +379,7 @@
         firstBlockError = error;
     }];
     [operation1 setResponseSerializer:[AFHTTPResponseSerializer serializer]];
-    
+
     NSURLRequest *request2 = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/1" relativeToURL:self.baseURL]];
     AFHTTPRequestOperation *operation2 = [[AFHTTPRequestOperation alloc] initWithRequest:request2];
     [operation2 setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
@@ -388,7 +388,7 @@
         secondBlockError = error;
     }];
     [operation2 setResponseSerializer:[AFHTTPResponseSerializer serializer]];
-    
+
     __block BOOL completionBlockFiredAfterOtherBlocks = NO;
     NSArray *batchRequests = [AFURLConnectionOperation batchOfRequestOperations:@[operation1, operation2] progressBlock:nil completionBlock:^(NSArray *operations) {
         if (firstBlock && secondBlock) {

+ 6 - 6
Tests/Tests/AFHTTPRequestSerializationTests.m

@@ -1,6 +1,6 @@
 // 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
 // of this software and associated documentation files (the "Software"), to deal
@@ -96,7 +96,7 @@
 
          return query;
      }];
-    
+
     NSURLRequest *originalRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://example.com"]];
     NSURLRequest *serializedRequest = [self.requestSerializer requestBySerializingRequest:originalRequest withParameters:@{@"key":@"value"} error:nil];
 
@@ -107,13 +107,13 @@
     NSMutableURLRequest *originalRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://example.com"]];
     Class streamClass = NSClassFromString(@"AFStreamingMultipartFormData");
     id <AFMultipartFormDataTest> formData = [[streamClass alloc] initWithURLRequest:originalRequest stringEncoding:NSUTF8StringEncoding];
-    
+
     NSURL *fileURL = [NSURL fileURLWithPath:[[NSBundle bundleForClass:[self class]] pathForResource:@"adn_0" ofType:@"cer"]];
-    
+
     [formData appendPartWithFileURL:fileURL name:@"test" error:NULL];
-    
+
     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"]);
 }
 

+ 1 - 1
Tests/Tests/AFHTTPResponseSerializationTests.m

@@ -1,6 +1,6 @@
 // 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
 // of this software and associated documentation files (the "Software"), to deal

+ 3 - 3
Tests/Tests/AFHTTPSessionManagerTests.m

@@ -1,6 +1,6 @@
 // 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
 // of this software and associated documentation files (the "Software"), to deal
@@ -104,7 +104,7 @@
         NSURL *dirURL  = [[[NSFileManager defaultManager] URLsForDirectory:NSLibraryDirectory inDomains:NSUserDomainMask] lastObject];
         return [dirURL URLByAppendingPathComponent:@"t1.file"];
     }];
-    
+
     NSURLSessionDownloadTask *downloadTask = [self.manager downloadTaskWithRequest:[NSURLRequest requestWithURL:self.baseURL]
                                                                           progress:nil
                                                                        destination:nil
@@ -122,7 +122,7 @@
     __block BOOL destinationBlockExecuted = NO;
     __block BOOL completionBlockExecuted = NO;
     __block NSURL *downloadFilePath = nil;
-    
+
     NSURLSessionDownloadTask *downloadTask = [self.manager downloadTaskWithRequest:[NSURLRequest requestWithURL:self.baseURL]
                                                                           progress:nil
                                                                        destination:^NSURL *(NSURL *targetPath, NSURLResponse *response) {

+ 2 - 2
Tests/Tests/AFJSONSerializationTests.m

@@ -1,6 +1,6 @@
 // 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
 // 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");
 }
 
-@end
+@end

+ 5 - 5
Tests/Tests/AFNetworkActivityManagerTests.m

@@ -1,6 +1,6 @@
 // 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
 // of this software and associated documentation files (the "Software"), to deal
@@ -61,7 +61,7 @@
     [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
         expect([self.mockApplication isNetworkActivityIndicatorVisible]).will.beFalsy();
     } failure:nil];
-    
+
     [operation start];
 
     expect([self.mockApplication isNetworkActivityIndicatorVisible]).will.beTruthy();
@@ -73,9 +73,9 @@
     [operation setCompletionBlockWithSuccess:nil failure:^(AFHTTPRequestOperation *operation, NSError *error) {
         expect([self.mockApplication isNetworkActivityIndicatorVisible]).will.beFalsy();
     }];
-    
+
     [operation start];
-    
+
     expect([self.mockApplication isNetworkActivityIndicatorVisible]).will.beTruthy();
 }
 
@@ -93,7 +93,7 @@
     [operation setCompletionBlockWithSuccess:nil failure:nil];
 
     [operation start];
-    
+
     expect(didChangeNetworkActivityIndicatorVisible).will.beFalsy();
 }
 

+ 1 - 1
Tests/Tests/AFPropertyListResponseSerializerTests.m

@@ -1,6 +1,6 @@
 // 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
 // of this software and associated documentation files (the "Software"), to deal

+ 35 - 35
Tests/Tests/AFSecurityPolicyTests.m

@@ -1,6 +1,6 @@
 // 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
 // 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"];
     NSCAssert(certPath != nil, @"Path for certificate should not be nil");
     NSData *certData = [NSData dataWithContentsOfFile:certPath];
-    
+
     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"];
     NSCAssert(certPath != nil, @"Path for certificate should not be nil");
     NSData *certData = [NSData dataWithContentsOfFile:certPath];
-    
+
     return SecCertificateCreateWithData(NULL, (__bridge CFDataRef)(certData));
 }
 
@@ -109,12 +109,12 @@ static SecCertificateRef AFUTSelfSignedCertificateWithDNSNameDomain() {
 static NSArray * AFCertificateTrustChainForServerTrust(SecTrustRef serverTrust) {
     CFIndex certificateCount = SecTrustGetCertificateCount(serverTrust);
     NSMutableArray *trustChain = [NSMutableArray arrayWithCapacity:(NSUInteger)certificateCount];
-    
+
     for (CFIndex i = 0; i < certificateCount; i++) {
         SecCertificateRef certificate = SecTrustGetCertificateAtIndex(serverTrust, i);
         [trustChain addObject:(__bridge_transfer NSData *)SecCertificateCopyData(certificate)];
     }
-    
+
     return [NSArray arrayWithArray:trustChain];
 }
 
@@ -139,17 +139,17 @@ static SecTrustRef AFUTTrustWithCertificate(SecCertificateRef certificate) {
     SecCertificateRef geotrustRootCertificate = AFUTGeotrustRootCertificate();
     SecCertificateRef rapidSSLCertificate = AFUTRapidSSLCertificate();
     SecCertificateRef httpBinCertificate = AFUTHTTPBinOrgCertificate();
-    
+
     [policy setPinnedCertificates:@[(__bridge_transfer NSData *)SecCertificateCopyData(geotrustRootCertificate),
                                     (__bridge_transfer NSData *)SecCertificateCopyData(rapidSSLCertificate),
                                     (__bridge_transfer NSData *)SecCertificateCopyData(httpBinCertificate)]];
-    
+
     CFRelease(geotrustRootCertificate);
     CFRelease(rapidSSLCertificate);
     CFRelease(httpBinCertificate);
-    
+
     [policy setValidatesCertificateChain:NO];
-    
+
     SecTrustRef trust = AFUTHTTPBinOrgServerTrust();
     XCTAssert([policy evaluateServerTrust:trust forDomain:nil], @"HTTPBin.org Public Key Pinning Mode Failed");
     CFRelease(trust);
@@ -174,17 +174,17 @@ static SecTrustRef AFUTTrustWithCertificate(SecCertificateRef certificate) {
     SecCertificateRef geotrustRootCertificate = AFUTGeotrustRootCertificate();
     SecCertificateRef rapidSSLCertificate = AFUTRapidSSLCertificate();
     SecCertificateRef httpBinCertificate = AFUTHTTPBinOrgCertificate();
-    
+
     [policy setPinnedCertificates:@[(__bridge_transfer NSData *)SecCertificateCopyData(geotrustRootCertificate),
                                     (__bridge_transfer NSData *)SecCertificateCopyData(rapidSSLCertificate),
                                     (__bridge_transfer NSData *)SecCertificateCopyData(httpBinCertificate)]];
-    
+
     CFRelease(geotrustRootCertificate);
     CFRelease(rapidSSLCertificate);
     CFRelease(httpBinCertificate);
-    
+
     [policy setValidatesCertificateChain:NO];
-    
+
     SecTrustRef trust = AFUTHTTPBinOrgServerTrust();
     XCTAssert([policy evaluateServerTrust:trust forDomain:nil], @"HTTPBin.org Public Key Pinning Mode Failed");
     CFRelease(trust);
@@ -226,21 +226,21 @@ static SecTrustRef AFUTTrustWithCertificate(SecCertificateRef certificate) {
 
 - (void)testCertificatePinningIsEnforcedForHTTPBinOrgPinnedCertificateWithDomainNameValidationAgainstHTTPBinOrgServerTrust {
     AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeCertificate];
-    
+
     SecCertificateRef geotrustRootCertificate = AFUTGeotrustRootCertificate();
     SecCertificateRef rapidSSLCertificate = AFUTRapidSSLCertificate();
     SecCertificateRef httpBinCertificate = AFUTHTTPBinOrgCertificate();
-    
+
     [policy setPinnedCertificates:@[(__bridge_transfer NSData *)SecCertificateCopyData(geotrustRootCertificate),
                                     (__bridge_transfer NSData *)SecCertificateCopyData(rapidSSLCertificate),
                                     (__bridge_transfer NSData *)SecCertificateCopyData(httpBinCertificate)]];
-    
+
     CFRelease(geotrustRootCertificate);
     CFRelease(rapidSSLCertificate);
     CFRelease(httpBinCertificate);
-    
+
     policy.validatesDomainName = YES;
-    
+
     SecTrustRef trust = AFUTHTTPBinOrgServerTrust();
     XCTAssert([policy evaluateServerTrust:trust forDomain:@"httpbin.org"], @"HTTPBin.org Public Key Pinning Mode Failed");
     CFRelease(trust);
@@ -248,19 +248,19 @@ static SecTrustRef AFUTTrustWithCertificate(SecCertificateRef certificate) {
 
 - (void)testCertificatePinningIsEnforcedForHTTPBinOrgPinnedCertificateWithCaseInsensitiveDomainNameValidationAgainstHTTPBinOrgServerTrust {
     AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModePublicKey];
-    
+
     SecCertificateRef geotrustRootCertificate = AFUTGeotrustRootCertificate();
     SecCertificateRef rapidSSLCertificate = AFUTRapidSSLCertificate();
     SecCertificateRef httpBinCertificate = AFUTHTTPBinOrgCertificate();
-    
+
     [policy setPinnedCertificates:@[(__bridge_transfer NSData *)SecCertificateCopyData(geotrustRootCertificate),
                                     (__bridge_transfer NSData *)SecCertificateCopyData(rapidSSLCertificate),
                                     (__bridge_transfer NSData *)SecCertificateCopyData(httpBinCertificate)]];
-    
+
     CFRelease(geotrustRootCertificate);
     CFRelease(rapidSSLCertificate);
     CFRelease(httpBinCertificate);
-    
+
     policy.validatesDomainName = YES;
 
     SecTrustRef trust = AFUTHTTPBinOrgServerTrust();
@@ -270,21 +270,21 @@ static SecTrustRef AFUTTrustWithCertificate(SecCertificateRef certificate) {
 
 - (void)testCertificatePinningIsEnforcedForHTTPBinOrgPinnedPublicKeyWithDomainNameValidationAgainstHTTPBinOrgServerTrust {
     AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModePublicKey];
-    
+
     SecCertificateRef geotrustRootCertificate = AFUTGeotrustRootCertificate();
     SecCertificateRef rapidSSLCertificate = AFUTRapidSSLCertificate();
     SecCertificateRef httpBinCertificate = AFUTHTTPBinOrgCertificate();
-    
+
     [policy setPinnedCertificates:@[(__bridge_transfer NSData *)SecCertificateCopyData(geotrustRootCertificate),
                                     (__bridge_transfer NSData *)SecCertificateCopyData(rapidSSLCertificate),
                                     (__bridge_transfer NSData *)SecCertificateCopyData(httpBinCertificate)]];
-    
+
     CFRelease(geotrustRootCertificate);
     CFRelease(rapidSSLCertificate);
     CFRelease(httpBinCertificate);
-    
+
     policy.validatesDomainName = YES;
-    
+
     SecTrustRef trust = AFUTHTTPBinOrgServerTrust();
     XCTAssert([policy evaluateServerTrust:trust forDomain:@"httpbin.org"], @"HTTPBin.org Public Key Pinning Mode Failed");
     CFRelease(trust);
@@ -293,7 +293,7 @@ static SecTrustRef AFUTTrustWithCertificate(SecCertificateRef certificate) {
 - (void)testCertificatePinningFailsForHTTPBinOrgIfNoCertificateIsPinned {
     AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeCertificate];
     [policy setPinnedCertificates:@[]];
-    
+
     SecTrustRef trust = AFUTHTTPBinOrgServerTrust();
     XCTAssert([policy evaluateServerTrust:trust forDomain:@"httpbin.org"] == NO, @"HTTPBin.org Certificate Pinning Should have failed with no pinned certificate");
     CFRelease(trust);
@@ -305,7 +305,7 @@ static SecTrustRef AFUTTrustWithCertificate(SecCertificateRef certificate) {
     [policy setPinnedCertificates:@[(__bridge_transfer NSData *)SecCertificateCopyData(certificate)]];
     CFRelease(certificate);
     policy.validatesDomainName = YES;
-    
+
     SecTrustRef trust = AFUTHTTPBinOrgServerTrust();
     XCTAssert([policy evaluateServerTrust:trust forDomain:@"www.httpbin.org"] == NO, @"HTTPBin.org Certificate Pinning Should have failed with no pinned certificate");
     CFRelease(trust);
@@ -465,10 +465,10 @@ static SecTrustRef AFUTTrustWithCertificate(SecCertificateRef certificate) {
 
 - (void)testDefaultPolicySetToCertificateChainFailsWithMissingChain {
     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
     [policy setPinnedCertificates:@[]];
-    
+
     SecTrustRef trust = AFUTHTTPBinOrgServerTrust();
     XCTAssert([policy evaluateServerTrust:trust forDomain:nil] == NO, @"Pinning with Certificate Chain Mode and Missing Chain should have failed");
     CFRelease(trust);
@@ -476,10 +476,10 @@ static SecTrustRef AFUTTrustWithCertificate(SecCertificateRef certificate) {
 
 - (void)testDefaultPolicySetToPublicKeyChainFailsWithMissingChain {
     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
     [policy setPinnedCertificates:@[]];
-    
+
     SecTrustRef trust = AFUTHTTPBinOrgServerTrust();
     XCTAssert([policy evaluateServerTrust:trust forDomain:nil] == NO, @"Pinning with Public Key Chain Mode and Missing Chain should have failed");
     CFRelease(trust);
@@ -499,13 +499,13 @@ static SecTrustRef AFUTTrustWithCertificate(SecCertificateRef certificate) {
 
 - (void)testPolicyWithPinningModeIsSetToNotAllowInvalidSSLCertificates {
     AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone];
-    
+
     XCTAssert(policy.allowInvalidCertificates == NO, @"policyWithPinningMode: should not allow invalid ssl certificates by default.");
 }
 
 - (void)testPolicyWithPinningModeIsSetToValidatesDomainName {
     AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone];
-    
+
     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
 //
-// 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
 // of this software and associated documentation files (the "Software"), to deal

+ 1 - 1
Tests/Tests/AFTestCase.m

@@ -1,6 +1,6 @@
 // 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
 // of this software and associated documentation files (the "Software"), to deal

+ 13 - 13
Tests/Tests/AFURLSessionManagerTests.m

@@ -1,6 +1,6 @@
 // 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
 // of this software and associated documentation files (the "Software"), to deal
@@ -39,43 +39,43 @@
 
 - (void)testUploadTasksProgressBecomesPartOfCurrentProgress {
     NSProgress *overallProgress = [NSProgress progressWithTotalUnitCount:100];
-    
+
     [overallProgress becomeCurrentWithPendingUnitCount:80];
     NSProgress *uploadProgress = nil;
-    
+
     [self.manager downloadTaskWithRequest:[NSURLRequest requestWithURL:self.baseURL]
                                  progress:&uploadProgress
                               destination:nil
                         completionHandler:nil];
     [overallProgress resignCurrent];
-    
+
     expect(overallProgress.fractionCompleted).to.equal(0);
-    
+
     uploadProgress.totalUnitCount = 1;
     uploadProgress.completedUnitCount = 1;
-    
-    
+
+
     expect(overallProgress.fractionCompleted).to.equal(0.8);
 }
 
 - (void)testDownloadTasksProgressBecomesPartOfCurrentProgress {
     NSProgress *overallProgress = [NSProgress progressWithTotalUnitCount:100];
-    
+
     [overallProgress becomeCurrentWithPendingUnitCount:80];
     NSProgress *downloadProgress = nil;
-    
+
     [self.manager downloadTaskWithRequest:[NSURLRequest requestWithURL:self.baseURL]
                                  progress:&downloadProgress
                               destination:nil
                         completionHandler:nil];
     [overallProgress resignCurrent];
-    
+
     expect(overallProgress.fractionCompleted).to.equal(0);
-    
+
     downloadProgress.totalUnitCount = 1;
     downloadProgress.completedUnitCount = 1;
-    
-    
+
+
     expect(overallProgress.fractionCompleted).to.equal(0.8);
 }
 

+ 1 - 1
UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h

@@ -1,6 +1,6 @@
 // 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
 // of this software and associated documentation files (the "Software"), to deal

+ 4 - 4
UIKit+AFNetworking/AFNetworkActivityIndicatorManager.m

@@ -1,6 +1,6 @@
 // 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
 // of this software and associated documentation files (the "Software"), to deal
@@ -121,7 +121,7 @@ static NSURLRequest * AFNetworkRequestFromNotification(NSNotification *notificat
 	@synchronized(self) {
 		_activityCount = activityCount;
 	}
-    
+
     dispatch_async(dispatch_get_main_queue(), ^{
         [self updateNetworkActivityIndicatorVisibilityDelayed];
     });
@@ -133,7 +133,7 @@ static NSURLRequest * AFNetworkRequestFromNotification(NSNotification *notificat
 		_activityCount++;
 	}
     [self didChangeValueForKey:@"activityCount"];
-    
+
     dispatch_async(dispatch_get_main_queue(), ^{
         [self updateNetworkActivityIndicatorVisibilityDelayed];
     });
@@ -148,7 +148,7 @@ static NSURLRequest * AFNetworkRequestFromNotification(NSNotification *notificat
 #pragma clang diagnostic pop
 	}
     [self didChangeValueForKey:@"activityCount"];
-    
+
     dispatch_async(dispatch_get_main_queue(), ^{
         [self updateNetworkActivityIndicatorVisibilityDelayed];
     });

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

@@ -1,6 +1,6 @@
 // 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
 // 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.
- 
+
  @param operation The operation. If `nil`, automatic updating from any previously specified operation will be disabled.
  */
 - (void)setAnimatingWithStateOfOperation:(AFURLConnectionOperation *)operation;

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

@@ -1,6 +1,6 @@
 // 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
 // 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
 //
-// 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
 // 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.
- 
+
  @param task The session task.
  @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.
- 
+
  @param task The session task.
  @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.

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

@@ -1,6 +1,6 @@
 // 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
 // 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
 //
-// 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
 // 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.
- 
+
  @warning Compound values for control `state` (such as `UIControlStateHighlighted | UIControlStateDisabled`) are unsupported.
  */
 @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.
- 
+
   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 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.
- 
+
  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 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.
@@ -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.
 
  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.
 
  @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.
- 
+
  @param state The control state.
  */
 - (void)cancelImageRequestOperationForState:(UIControlState)state;
 
 /**
  Cancels any executing background image operation for the specified control state of the receiver, if one exists.
- 
+
  @param state The control state.
  */
 - (void)cancelBackgroundImageRequestOperationForState:(UIControlState)state;

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

@@ -1,6 +1,6 @@
 // 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
 // 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
 //
-// 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
 // of this software and associated documentation files (the "Software"), to deal
@@ -46,7 +46,7 @@
 
 /**
  Set the cache used for image loading.
- 
+
  @param imageCache The image cache.
  */
 + (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`.
- 
+
  @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;
@@ -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.
 
  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;
 
 /**
- 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.
 
  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;
 
 /**
- 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 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.
@@ -123,16 +123,16 @@
 
 /**
  Returns a cached image for the specififed request, if available.
- 
+
  @param request The image request.
- 
+
  @return The cached image.
  */
 - (UIImage *)cachedImageForRequest:(NSURLRequest *)request;
 
 /**
  Caches a particular image for the specified request.
- 
+
  @param image The image to cache.
  @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
 //
-// 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
 // of this software and associated documentation files (the "Software"), to deal
@@ -140,7 +140,7 @@
         if (placeholderImage) {
             self.image = placeholderImage;
         }
-        
+
         __weak __typeof(self)weakSelf = self;
         self.af_imageRequestOperation = [[AFHTTPRequestOperation alloc] initWithRequest:urlRequest];
         self.af_imageRequestOperation.responseSerializer = self.imageResponseSerializer;

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

@@ -1,6 +1,6 @@
 // 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
 // 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.
- 
+
  @param task The session task.
  @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
 //
-// 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
 // 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
 //
-// 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
 // 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.
- 
+
  @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)
@@ -50,7 +50,7 @@
 
 /**
  Asynchronously loads the specified request.
- 
+
  @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 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
 //
-// 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
 // of this software and associated documentation files (the "Software"), to deal