You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@abdera.apache.org by ca...@apache.org on 2008/11/04 01:05:44 UTC

svn commit: r711131 - /incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/AbstractClientResponse.java

Author: calavera
Date: Mon Nov  3 16:05:44 2008
New Revision: 711131

URL: http://svn.apache.org/viewvc?rev=711131&view=rev
Log:
[ABDERA-201]: Does not support HTTP header Expires -1 and throw org.apache.commons.httpclient.util.DateParseException: Unable to parse the date -1

If the header is not valid the cache should be expired, fragment from the RFC 2616:

HTTP/1.1 clients and caches MUST treat other invalid date formats,
   especially including the value "0", as in the past (i.e., "already
   expired").

Modified:
    incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/AbstractClientResponse.java

Modified: incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/AbstractClientResponse.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/AbstractClientResponse.java?rev=711131&r1=711130&r2=711131&view=diff
==============================================================================
--- incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/AbstractClientResponse.java (original)
+++ incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/AbstractClientResponse.java Mon Nov  3 16:05:44 2008
@@ -201,7 +201,7 @@
         return DateUtil.parseDate(value);
       else return null;
     } catch (DateParseException e) {
-      throw new RuntimeException(e); // server likely returned a bad date format
+      return null; //treat other invalid date formats, especially including the value "0", as in the past
     }
   }
 }