Merge pull request #489 from mgunneras/http-headers

Ability to add custom http headers to appcast request
This commit is contained in:
Kornel committed 2015-02-26 01:10:55 +00:00
commit f216ef7a13
5 files changed
+13 -1

No files matched your search

+1
View File
@@ -19,6 +19,7 @@ SU_EXPORT @interface SUAppcast : NSObject <NSURLDownloadDelegate>
@property (weak) id<SUAppcastDelegate> delegate;
@property (copy) NSString *userAgentString;
@property (copy) NSDictionary *httpHeaders;
- (void)fetchAppcastFromURL:(NSURL *)url;
+8
View File
@@ -45,6 +45,7 @@
@synthesize downloadFilename;
@synthesize delegate;
@synthesize userAgentString;
@synthesize httpHeaders;
@synthesize download;
@synthesize items;
@@ -55,6 +56,13 @@
[request setValue:self.userAgentString forHTTPHeaderField:@"User-Agent"];
}
if (self.httpHeaders) {
for (NSString *key in self.httpHeaders) {
id value = [self.httpHeaders objectForKey:key];
[request setValue:value forHTTPHeaderField:key];
}
}
[request setValue:@"application/rss+xml,*/*;q=0.1" forHTTPHeaderField:@"Accept"];
self.download = [[NSURLDownload alloc] initWithRequest:request delegate:self];
+1
View File
@@ -56,6 +56,7 @@
[appcast setDelegate:self];
[appcast setUserAgentString:[self.updater userAgentString]];
[appcast setHttpHeaders:[self.updater httpHeaders]];
[appcast fetchAppcastFromURL:URL];
}
+2
View File
@@ -46,6 +46,8 @@ SU_EXPORT @interface SUUpdater : NSObject
@property (nonatomic, copy) NSString *userAgentString;
@property (copy) NSDictionary *httpHeaders;
@property BOOL sendsSystemProfile;
@property BOOL automaticallyDownloadsUpdates;
+1 -1
View File
@@ -51,7 +51,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
@synthesize delegate;
@synthesize checkTimer;
@synthesize userAgentString = customUserAgentString;
@synthesize httpHeaders;
@synthesize driver;
@synthesize host;