File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ SU_EXPORT @interface SUAppcast : NSObject <NSURLDownloadDelegate>
1919
2020@property (weak ) id <SUAppcastDelegate> delegate;
2121@property (copy ) NSString *userAgentString;
22+ @property (copy ) NSDictionary *httpHeaders;
2223
2324- (void )fetchAppcastFromURL : (NSURL *)url ;
2425
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ @implementation SUAppcast
4545@synthesize downloadFilename;
4646@synthesize delegate;
4747@synthesize userAgentString;
48+ @synthesize httpHeaders;
4849@synthesize download;
4950@synthesize items;
5051
@@ -55,6 +56,13 @@ - (void)fetchAppcastFromURL:(NSURL *)url
5556 [request setValue: self .userAgentString forHTTPHeaderField: @" User-Agent" ];
5657 }
5758
59+ if (self.httpHeaders ) {
60+ for (NSString *key in self.httpHeaders ) {
61+ id value = [self .httpHeaders objectForKey: key];
62+ [request setValue: value forHTTPHeaderField: key];
63+ }
64+ }
65+
5866 [request setValue: @" application/rss+xml,*/*;q=0.1" forHTTPHeaderField: @" Accept" ];
5967
6068 self.download = [[NSURLDownload alloc ] initWithRequest: request delegate: self ];
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ - (void)checkForUpdatesAtURL:(NSURL *)URL host:(SUHost *)aHost
5656
5757 [appcast setDelegate: self ];
5858 [appcast setUserAgentString: [self .updater userAgentString ]];
59+ [appcast setHttpHeaders: [self .updater httpHeaders ]];
5960 [appcast fetchAppcastFromURL: URL];
6061}
6162
Original file line number Diff line number Diff line change @@ -46,6 +46,8 @@ SU_EXPORT @interface SUUpdater : NSObject
4646
4747@property (nonatomic , copy ) NSString *userAgentString;
4848
49+ @property (copy ) NSDictionary *httpHeaders;
50+
4951@property BOOL sendsSystemProfile;
5052
5153@property BOOL automaticallyDownloadsUpdates;
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ @implementation SUUpdater
5151@synthesize delegate;
5252@synthesize checkTimer;
5353@synthesize userAgentString = customUserAgentString;
54-
54+ @synthesize httpHeaders;
5555@synthesize driver;
5656@synthesize host;
5757
You can’t perform that action at this time.
0 commit comments