mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
Change GSHTTPDigest to GSHTTPAuthentication ... more appropriate name.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23090 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8b55e40030
commit
2a2814fbe6
3 changed files with 213 additions and 49 deletions
|
@ -580,16 +580,16 @@ static void debugWrite(GSHTTPURLHandle *handle, NSData *data)
|
|||
if ([a hasPrefix: @"Basic"] == YES
|
||||
&& (ah = [document headerNamed: @"WWW-Authenticate"]) != nil)
|
||||
{
|
||||
NSString *realm;
|
||||
NSString *ac;
|
||||
NSURLProtectionSpace *space;
|
||||
NSString *ac;
|
||||
|
||||
ac = [ah value];
|
||||
realm = [GSHTTPDigest digestRealmForAuthentication: ac];
|
||||
if (realm != nil)
|
||||
space = [GSHTTPAuthentication
|
||||
protectionSpaceForAuthentication: ac requestURL: url];
|
||||
if (space != nil)
|
||||
{
|
||||
NSURLProtectionSpace *space;
|
||||
NSURLCredential *cred;
|
||||
GSHTTPDigest *digest;
|
||||
GSHTTPAuthentication *digest;
|
||||
NSString *method;
|
||||
NSString *a;
|
||||
|
||||
|
@ -602,27 +602,14 @@ static void debugWrite(GSHTTPURLHandle *handle, NSData *data)
|
|||
password: [url password]
|
||||
persistence: NSURLCredentialPersistenceForSession];
|
||||
|
||||
/*
|
||||
* Create protection space from the information in
|
||||
* the URL and the realm of the authentication
|
||||
* challenge.
|
||||
*/
|
||||
space = [[NSURLProtectionSpace alloc]
|
||||
initWithHost: [url host]
|
||||
port: [[url port] intValue]
|
||||
protocol: [url scheme]
|
||||
realm: realm
|
||||
authenticationMethod:
|
||||
NSURLAuthenticationMethodHTTPDigest];
|
||||
|
||||
/*
|
||||
* Get the digest object and ask it for a header
|
||||
* to use for authorisation.
|
||||
*/
|
||||
digest = [GSHTTPDigest digestWithCredential: cred
|
||||
inProtectionSpace: space];
|
||||
digest = [GSHTTPAuthentication
|
||||
digestWithCredential: cred
|
||||
inProtectionSpace: space];
|
||||
RELEASE(cred);
|
||||
RELEASE(space);
|
||||
|
||||
method = [request objectForKey: GSHTTPPropertyMethodKey];
|
||||
if (method == nil)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue