Toggle navigation
Toggle navigation
This project
Loading...
Sign in
iOS
/
asi-http-request
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Ben Copsey
2011-05-08 11:23:59 +0100
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
af3e4db0f6f8d515faf76af3cb49a5ffeb1de447
af3e4db0
2 parents
a20c1187
5262af3f
Merge branch 'auth-tweaks'
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
Classes/ASIHTTPRequest.m
Classes/Tests/ASIHTTPRequestTests.m
Classes/ASIHTTPRequest.m
View file @
af3e4db
This diff is collapsed. Click to expand it.
Classes/Tests/ASIHTTPRequestTests.m
View file @
af3e4db
...
...
@@ -1087,6 +1087,16 @@
err
=
[
request
error
];
GHAssertNil
(
err
,
@"Failed to reuse credentials"
);
// Ensure new credentials are used in place of those in the session
request
=
[[[
ASIHTTPRequest
alloc
]
initWithURL
:[
NSURL
URLWithString
:
@"http://allseeing-i.com/ASIHTTPRequest/tests/basic-authentication-new-credentials"
]]
autorelease
];
[
request
setUsername
:
@"secret_username_2"
];
[
request
setPassword
:
@"secret_password_2"
];
[
request
setUseSessionPersistence
:
YES
];
[
request
setUseKeychainPersistence
:
NO
];
[
request
startSynchronous
];
err
=
[
request
error
];
GHAssertNil
(
err
,
@"Failed to reuse credentials"
);
[
ASIHTTPRequest
clearSession
];
// Ensure credentials stored in the session were wiped
...
...
@@ -1103,7 +1113,7 @@
err
=
[
request
error
];
GHAssertNil
(
err
,
@"Failed to use stored credentials"
);
[
ASIHTTPRequest
removeCredentialsForHost
:
@"a
llseeing-i.com
"
port
:
0
protocol
:
@"http"
realm
:
@"SECRET_STUFF"
];
[
ASIHTTPRequest
removeCredentialsForHost
:
@"a
si
"
port
:
0
protocol
:
@"http"
realm
:
@"SECRET_STUFF"
];
// Ensure credentials stored in the keychain were wiped
request
=
[[[
ASIHTTPRequest
alloc
]
initWithURL
:
url
]
autorelease
];
...
...
@@ -1424,7 +1434,7 @@
{
ASIHTTPRequest
*
request
=
[
ASIHTTPRequest
requestWithURL
:[
NSURL
URLWithString
:
@"http://allseeing-i.com/ASIHTTPRequest/tests/redirect_to_new_domain"
]];
[
request
startSynchronous
];
BOOL
success
=
[[[
request
url
]
absoluteString
]
isEqualToString
:
@"http://www.apple.com
/
"
];
BOOL
success
=
[[[
request
url
]
absoluteString
]
isEqualToString
:
@"http://www.apple.com"
];
GHAssertTrue
(
success
,
@"Failed to redirect to a different domain"
);
}
...
...
Please
register
or
login
to post a comment