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
2009-08-23 16:25:34 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2a2a196e0464bb17392fec2dbeb6434361026d8a
2a2a196e
1 parent
58b7645a
Fix proxy dialog
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
3 deletions
Classes/ASIAuthenticationDialog.m
Classes/ASIHTTPRequest.m
Classes/ASIAuthenticationDialog.m
View file @
2a2a196
...
...
@@ -89,7 +89,11 @@ NSLock *dialogLock = nil;
[
items
addObject
:
backButton
];
label
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
170
,
50
)];
if
([
self
type
]
==
ASIProxyAuthenticationType
)
{
[
label
setText
:[[
self
request
]
proxyHost
]];
}
else
{
[
label
setText
:[[[
self
request
]
url
]
host
]];
}
[
label
setTextColor
:[
UIColor
whiteColor
]];
[
label
setFont
:[
UIFont
boldSystemFontOfSize
:
22
.
0
]];
[
label
setShadowColor
:[
UIColor
colorWithRed
:
0
green
:
0
blue
:
0
alpha
:
0
.
5
]];
...
...
@@ -122,10 +126,30 @@ NSLock *dialogLock = nil;
-
(
void
)
loginWithCredentialsFromDialog
:
(
id
)
sender
{
[[
self
request
]
setUsername
:[[[[[[[
self
loginDialog
]
subviews
]
objectAtIndex
:
0
]
cellForRowAtIndexPath
:[
NSIndexPath
indexPathForRow
:
0
inSection
:
0
]]
subviews
]
objectAtIndex
:
2
]
text
]];
[[
self
request
]
setPassword
:[[[[[[[
self
loginDialog
]
subviews
]
objectAtIndex
:
0
]
cellForRowAtIndexPath
:[
NSIndexPath
indexPathForRow
:
0
inSection
:
1
]]
subviews
]
objectAtIndex
:
2
]
text
]];
NSString
*
username
=
[[[[[[[
self
loginDialog
]
subviews
]
objectAtIndex
:
0
]
cellForRowAtIndexPath
:[
NSIndexPath
indexPathForRow
:
0
inSection
:
0
]]
subviews
]
objectAtIndex
:
2
]
text
];
NSString
*
password
=
[[[[[[[
self
loginDialog
]
subviews
]
objectAtIndex
:
0
]
cellForRowAtIndexPath
:[
NSIndexPath
indexPathForRow
:
0
inSection
:
1
]]
subviews
]
objectAtIndex
:
2
]
text
];
if
([
self
type
]
==
ASIProxyAuthenticationType
)
{
[[
self
request
]
setProxyUsername
:
username
];
[[
self
request
]
setProxyPassword
:
password
];
}
else
{
[[
self
request
]
setUsername
:
username
];
[[
self
request
]
setPassword
:
password
];
}
// Handle NTLM domains
NSString
*
scheme
=
([
self
type
]
==
ASIStandardAuthenticationType
)
?
[[
self
request
]
authenticationScheme
]
:
[[
self
request
]
proxyAuthenticationScheme
];
if
([
scheme
isEqualToString
:(
NSString
*
)
kCFHTTPAuthenticationSchemeNTLM
])
{
NSString
*
domain
=
[[[[[[[
self
loginDialog
]
subviews
]
objectAtIndex
:
0
]
cellForRowAtIndexPath
:[
NSIndexPath
indexPathForRow
:
0
inSection
:
2
]]
subviews
]
objectAtIndex
:
2
]
text
];
if
([
self
type
]
==
ASIProxyAuthenticationType
)
{
[[
self
request
]
setProxyDomain
:
domain
];
}
else
{
[[
self
request
]
setDomain
:
domain
];
}
}
[[
self
loginDialog
]
dismissWithClickedButtonIndex
:
1
animated
:
YES
];
[[
self
request
]
retry
WithAuthentication
];
[[
self
request
]
retry
UsingSuppliedCredentials
];
}
...
...
Classes/ASIHTTPRequest.m
View file @
2a2a196
...
...
@@ -163,6 +163,7 @@ static NSRecursiveLock *delegateAuthenticationLock = nil;
[
self
setShouldResetProgressIndicators
:
YES
];
[
self
setAllowCompressedResponse
:
YES
];
[
self
setDefaultResponseEncoding
:
NSISOLatin1StringEncoding
];
[
self
setShouldPresentProxyAuthenticationDialog
:
YES
];
[
self
setTimeOutSeconds
:
10
];
[
self
setUseSessionPersistance
:
YES
];
...
...
Please
register
or
login
to post a comment