Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ios
/
yh_sdwebimage
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
Bogdan Poplauschi
9 years ago
Commit
dcb7985c5c1523ee7bb5d7f938f7b2f97d134c51
1 parent
3b9c0914
Replaced #1345 - Added urlCredential property to SDWebImageDownloader
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletions
SDWebImage/SDWebImageDownloader.h
SDWebImage/SDWebImageDownloader.m
SDWebImage/SDWebImageDownloader.h
View file @
dcb7985
...
...
@@ -110,6 +110,11 @@ typedef NSDictionary *(^SDWebImageDownloaderHeadersFilterBlock)(NSURL *url, NSDi
+
(
SDWebImageDownloader
*
)
sharedDownloader
;
/**
* Set the default URL credential to be set for request operations.
*/
@property
(
strong
,
nonatomic
)
NSURLCredential
*
urlCredential
;
/**
* Set username
*/
@property
(
strong
,
nonatomic
)
NSString
*
username
;
...
...
SDWebImage/SDWebImageDownloader.m
View file @
dcb7985
...
...
@@ -172,7 +172,9 @@ static NSString *const kCompletedCallbackKey = @"completed";
}]
;
operation
.
shouldDecompressImages
=
wself
.
shouldDecompressImages
;
if
(
wself
.
username
&&
wself
.
password
)
{
if
(
wself
.
urlCredential
)
{
operation
.
credential
=
wself
.
urlCredential
;
}
else
if
(
wself
.
username
&&
wself
.
password
)
{
operation
.
credential
=
[
NSURLCredential
credentialWithUser
:
wself
.
username
password
:
wself
.
password
persistence
:
NSURLCredentialPersistenceForSession
]
;
}
...
...
Please
register
or
login
to post a comment