Added ability to inject custom http headers in appcast request

This commit is contained in:
Mattias Gunneras committed 2015-02-25 09:42:31 -05:00
1 parent 2a1760a5a9
commit 0a6de47783
5 files changed
+10 -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;
+5
View File
@@ -45,6 +45,7 @@
@synthesize downloadFilename;
@synthesize delegate;
@synthesize userAgentString;
@synthesize httpHeaders;
@synthesize download;
@synthesize items;
@@ -55,6 +56,10 @@
[request setValue:self.userAgentString forHTTPHeaderField:@"User-Agent"];
}
if (self.httpHeaders) {
[request setValuesForKeysWithDictionary:self.httpHeaders];
}
[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;