Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
a test with http://validator.w3.org/feed/#validate_by_input shows that the time format was wrong; we must use RFC-822
Michael Peter Christenb07afbc115d5
diff --git a/source/net/yacy/cora/document/feed/RSSMessage.java b/source/net/yacy/cora/document/feed/RSSMessage.javaindex c39892425..fac200167 100644--- a/source/net/yacy/cora/document/feed/RSSMessage.java+++ b/source/net/yacy/cora/document/feed/RSSMessage.java@@ -36,7 +36,6 @@ import java.util.Map;import java.util.Set;import net.yacy.cora.date.GenericFormatter;-import net.yacy.cora.date.ISO8601Formatter;import net.yacy.cora.document.id.MultiProtocolURL;import net.yacy.cora.lod.vocabulary.DublinCore;import net.yacy.cora.lod.vocabulary.Geo;@@ -121,7 +120,7 @@ public class RSSMessage implements Hit, Comparable<RSSMessage>, Comparator<RSSMeif (title.length() > 0) this.map.put(Token.title.name(), title);if (description.length() > 0) this.map.put(Token.description.name(), description);if (link.length() > 0) this.map.put(Token.link.name(), link);- this.map.put(Token.pubDate.name(), ISO8601Formatter.FORMATTER.format());+ this.map.put(Token.pubDate.name(), HeaderFramework.FORMAT_RFC1123.format(new Date()));this.map.put(Token.guid.name(), artificialGuidPrefix + Integer.toHexString((title + description + link).hashCode()));}@@ -130,7 +129,7 @@ public class RSSMessage implements Hit, Comparable<RSSMessage>, Comparator<RSSMeif (title.length() > 0) this.map.put(Token.title.name(), title);if (description.length() > 0) this.map.put(Token.description.name(), description);this.map.put(Token.link.name(), link.toNormalform(true));- this.map.put(Token.pubDate.name(), ISO8601Formatter.FORMATTER.format());+ this.map.put(Token.pubDate.name(), HeaderFramework.FORMAT_RFC1123.format(new Date()));if (guid.length() > 0) this.map.put(Token.guid.name(), guid);}@@ -218,7 +217,7 @@ public class RSSMessage implements Hit, Comparable<RSSMessage>, Comparator<RSSMefinal String dateString = Token.pubDate.valueFrom(this.map, "");Date date;try {- date = ISO8601Formatter.FORMATTER.parse(dateString);+ date = HeaderFramework.FORMAT_RFC1123.parse(dateString);} catch (final ParseException e) {try {date = GenericFormatter.SHORT_SECOND_FORMATTER.parse(dateString);@@ -338,7 +337,7 @@ public class RSSMessage implements Hit, Comparable<RSSMessage>, Comparator<RSSMe@Overridepublic void setPubDate(final Date pubdate) {- setValue(Token.pubDate, ISO8601Formatter.FORMATTER.format(pubdate));+ setValue(Token.pubDate, HeaderFramework.FORMAT_RFC1123.format(pubdate));}@Overridediff --git a/source/net/yacy/cora/protocol/HeaderFramework.java b/source/net/yacy/cora/protocol/HeaderFramework.javaindex 4e67927cb..9329c74a2 100644--- a/source/net/yacy/cora/protocol/HeaderFramework.java+++ b/source/net/yacy/cora/protocol/HeaderFramework.java@@ -251,10 +251,10 @@ public class HeaderFramework extends TreeMap<String, String> implements Map<Striprivate static final String PATTERN_RFC1036 = "EEEE, dd-MMM-yy HH:mm:ss zzz";private static final String PATTERN_ANSIC = "EEE MMM d HH:mm:ss yyyy";private static final String PATTERN_GSAFS = "yyyy-MM-dd";- private static final SimpleDateFormat FORMAT_RFC1123 = new SimpleDateFormat(PATTERN_RFC1123, Locale.US);- private static final SimpleDateFormat FORMAT_RFC1036 = new SimpleDateFormat(PATTERN_RFC1036, Locale.US);- private static final SimpleDateFormat FORMAT_ANSIC = new SimpleDateFormat(PATTERN_ANSIC, Locale.US);- private static final SimpleDateFormat FORMAT_GSAFS = new SimpleDateFormat(PATTERN_GSAFS, Locale.US);+ public static final SimpleDateFormat FORMAT_RFC1123 = new SimpleDateFormat(PATTERN_RFC1123, Locale.US);+ public static final SimpleDateFormat FORMAT_RFC1036 = new SimpleDateFormat(PATTERN_RFC1036, Locale.US);+ public static final SimpleDateFormat FORMAT_ANSIC = new SimpleDateFormat(PATTERN_ANSIC, Locale.US);+ public static final SimpleDateFormat FORMAT_GSAFS = new SimpleDateFormat(PATTERN_GSAFS, Locale.US);private static final TimeZone TZ_GMT = TimeZone.getTimeZone("GMT");private static final Calendar CAL_GMT = Calendar.getInstance(TZ_GMT, Locale.US);