[Issue #719] Adding shouldUseCredentialStorage property to AFURLConnectionOperation /thanks Xihe Yu
This commit is contained in:
parent
1e7c45c191
commit
9aeb38649b
2 changed files with 17 additions and 3 deletions
|
|
@ -126,9 +126,16 @@
|
||||||
@property (readonly, nonatomic, assign) NSStringEncoding responseStringEncoding;
|
@property (readonly, nonatomic, assign) NSStringEncoding responseStringEncoding;
|
||||||
|
|
||||||
|
|
||||||
///--------------------------------
|
///-------------------------------
|
||||||
/// @name Accessing URL Credentials
|
/// @name Managing URL Credentials
|
||||||
///--------------------------------
|
///-------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
Whether the URL connection should consult the credential storage for authenticating the connection. `YES` by default.
|
||||||
|
|
||||||
|
@discussion This is the value that is returned in the `NSURLConnectionDelegate` method `-connectionShouldUseCredentialStorage:`.
|
||||||
|
*/
|
||||||
|
@property (nonatomic, assign) BOOL shouldUseCredentialStorage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The credential used for authentication challenges in `-connection:didReceiveAuthenticationChallenge:`.
|
The credential used for authentication challenges in `-connection:didReceiveAuthenticationChallenge:`.
|
||||||
|
|
|
||||||
|
|
@ -145,6 +145,7 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
|
||||||
@dynamic inputStream;
|
@dynamic inputStream;
|
||||||
@synthesize outputStream = _outputStream;
|
@synthesize outputStream = _outputStream;
|
||||||
@synthesize credential = _credential;
|
@synthesize credential = _credential;
|
||||||
|
@synthesize shouldUseCredentialStorage = _shouldUseCredentialStorage;
|
||||||
@synthesize userInfo = _userInfo;
|
@synthesize userInfo = _userInfo;
|
||||||
@synthesize backgroundTaskIdentifier = _backgroundTaskIdentifier;
|
@synthesize backgroundTaskIdentifier = _backgroundTaskIdentifier;
|
||||||
@synthesize uploadProgress = _uploadProgress;
|
@synthesize uploadProgress = _uploadProgress;
|
||||||
|
|
@ -205,6 +206,8 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
|
||||||
self.runLoopModes = [NSSet setWithObject:NSRunLoopCommonModes];
|
self.runLoopModes = [NSSet setWithObject:NSRunLoopCommonModes];
|
||||||
|
|
||||||
self.request = urlRequest;
|
self.request = urlRequest;
|
||||||
|
|
||||||
|
self.shouldUseCredentialStorage = YES;
|
||||||
|
|
||||||
self.outputStream = [NSOutputStream outputStreamToMemory];
|
self.outputStream = [NSOutputStream outputStreamToMemory];
|
||||||
|
|
||||||
|
|
@ -573,6 +576,10 @@ didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL)connectionShouldUseCredentialStorage:(NSURLConnection __unused *)connection {
|
||||||
|
return self.shouldUseCredentialStorage;
|
||||||
|
}
|
||||||
|
|
||||||
- (NSInputStream *)connection:(NSURLConnection __unused *)connection
|
- (NSInputStream *)connection:(NSURLConnection __unused *)connection
|
||||||
needNewBodyStream:(NSURLRequest *)request
|
needNewBodyStream:(NSURLRequest *)request
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue