diff --git a/baRSS.xcodeproj/xcshareddata/xcschemes/baRSS.xcscheme b/baRSS.xcodeproj/xcshareddata/xcschemes/baRSS.xcscheme new file mode 100644 index 0000000..3bc194c --- /dev/null +++ b/baRSS.xcodeproj/xcshareddata/xcschemes/baRSS.xcscheme @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/baRSS/Core Data/FeedMeta+Ext.h b/baRSS/Core Data/FeedMeta+Ext.h index 2857957..2a297f8 100644 --- a/baRSS/Core Data/FeedMeta+Ext.h +++ b/baRSS/Core Data/FeedMeta+Ext.h @@ -32,7 +32,6 @@ static int32_t const kDefaultFeedRefreshInterval = 30 * 60; - (void)setSucessfulWithResponse:(NSHTTPURLResponse*)response; // Setter - (void)setUrlIfChanged:(NSString*)url; -- (void)setEtag:(NSString*)etag modified:(NSString*)modified; - (BOOL)setRefreshAndSchedule:(int32_t)refresh; - (void)scheduleNow:(NSTimeInterval)future; @end diff --git a/baRSS/Core Data/FeedMeta+Ext.m b/baRSS/Core Data/FeedMeta+Ext.m index 7c9e573..3c1c784 100644 --- a/baRSS/Core Data/FeedMeta+Ext.m +++ b/baRSS/Core Data/FeedMeta+Ext.m @@ -54,7 +54,10 @@ - (void)setSucessfulWithResponse:(NSHTTPURLResponse*)response { self.errorCount = 0; // reset counter NSDictionary *header = [response allHeaderFields]; - [self setEtag:header[@"Etag"] modified:header[@"Date"]]; // @"Expires", @"Last-Modified" + if (response.statusCode != 304) { // not all servers set etag / modified when returning 304 + [self setEtag:header[@"Etag"] modified:header[@"Last-Modified"]]; + [self setUrlIfChanged:response.URL.absoluteString]; + } [self scheduleNow:self.refresh]; } diff --git a/baRSS/Feed Import/WebFeed.m b/baRSS/Feed Import/WebFeed.m index 45bd0c3..e46b700 100644 --- a/baRSS/Feed Import/WebFeed.m +++ b/baRSS/Feed Import/WebFeed.m @@ -70,9 +70,10 @@ static _Atomic(NSUInteger) _queueSize = 0; + (NSURLRequest*)newRequest:(FeedMeta*)meta ignoreCache:(BOOL)flag { NSMutableURLRequest *req = [self newRequestURL:meta.url]; if (!flag) { + // Both fields should be sent (if server provides both) RFC: https://tools.ietf.org/html/rfc7232#section-2.4 if (meta.etag.length > 0) [req setValue:meta.etag forHTTPHeaderField:@"If-None-Match"]; // ETag - else if (meta.modified.length > 0) + if (meta.modified.length > 0) [req setValue:meta.modified forHTTPHeaderField:@"If-Modified-Since"]; } if (!_requestsAreUrgent) // any request that is not forced, is a background update diff --git a/baRSS/Info.plist b/baRSS/Info.plist index 8815b40..2282565 100644 --- a/baRSS/Info.plist +++ b/baRSS/Info.plist @@ -70,7 +70,7 @@ CFBundleVersion - 11387 + 11491 LSApplicationCategoryType public.app-category.news LSMinimumSystemVersion diff --git a/baRSS/Preferences/General Tab/SettingsGeneral.m b/baRSS/Preferences/General Tab/SettingsGeneral.m index dbfee87..6b10ab9 100644 --- a/baRSS/Preferences/General Tab/SettingsGeneral.m +++ b/baRSS/Preferences/General Tab/SettingsGeneral.m @@ -83,4 +83,6 @@ }]; } +// x-apple.systempreferences:com.apple.preferences.users?startupItemsPref + @end