mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-29 05:24:26 +00:00
Merge pull request #489 from mgunneras/http-headers
Ability to add custom http headers to appcast request
This commit is contained in:
commit
f216ef7a13
5 files changed
+13
-1
No files matched your search
Vendored
+1
@@ -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;
|
||||
|
||||
|
||||
Vendored
+8
@@ -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];
|
||||
|
||||
Vendored
+1
@@ -56,6 +56,7 @@
|
||||
|
||||
[appcast setDelegate:self];
|
||||
[appcast setUserAgentString:[self.updater userAgentString]];
|
||||
[appcast setHttpHeaders:[self.updater httpHeaders]];
|
||||
[appcast fetchAppcastFromURL:URL];
|
||||
}
|
||||
|
||||
|
||||
Vendored
+2
@@ -46,6 +46,8 @@ SU_EXPORT @interface SUUpdater : NSObject
|
||||
|
||||
@property (nonatomic, copy) NSString *userAgentString;
|
||||
|
||||
@property (copy) NSDictionary *httpHeaders;
|
||||
|
||||
@property BOOL sendsSystemProfile;
|
||||
|
||||
@property BOOL automaticallyDownloadsUpdates;
|
||||
|
||||
Vendored
+1
-1
@@ -51,7 +51,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
|
||||
@synthesize delegate;
|
||||
@synthesize checkTimer;
|
||||
@synthesize userAgentString = customUserAgentString;
|
||||
|
||||
@synthesize httpHeaders;
|
||||
@synthesize driver;
|
||||
@synthesize host;
|
||||
|
||||
|
||||
Reference in new issue
Block a user