Bug 1241810 - FeedSubscription: Treat ETag and "Last modified" header as optional. r=mcomella
Some services just do not return any of those headers.
MozReview-Commit-ID: 3LpvZqsHgzJ
--- a/mobile/android/base/java/org/mozilla/gecko/feeds/subscriptions/FeedSubscription.java
+++ b/mobile/android/base/java/org/mozilla/gecko/feeds/subscriptions/FeedSubscription.java
@@ -51,18 +51,18 @@ public class FeedSubscription {
FeedSubscription subscription = new FeedSubscription();
subscription.feedUrl = object.getString(JSON_KEY_FEED_URL);
subscription.feedTitle = object.getString(JSON_KEY_FEED_TITLE);
subscription.websiteUrl = object.getString(JSON_KEY_WEBSITE_URL);
subscription.lastItemTitle = object.getString(JSON_KEY_LAST_ITEM_TITLE);
subscription.lastItemUrl = object.getString(JSON_KEY_LAST_ITEM_URL);
subscription.lastItemTimestamp = object.getLong(JSON_KEY_LAST_ITEM_TIMESTAMP);
- subscription.etag = object.getString(JSON_KEY_ETAG);
- subscription.lastModified = object.getString(JSON_KEY_LAST_MODIFIED);
+ subscription.etag = object.optString(JSON_KEY_ETAG);
+ subscription.lastModified = object.optString(JSON_KEY_LAST_MODIFIED);
subscription.bookmarkGuid = object.getString(JSON_KEY_BOOKMARK_GUID);
return subscription;
}
/* package-private */ void update(FeedFetcher.FeedResponse response) {
final String feedUrl = response.feed.getFeedURL();
if (!TextUtils.isEmpty(feedUrl)) {