abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r443129 - /incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/EntityTag.java
Date Wed, 13 Sep 2006 21:26:31 GMT
Author: jmsnell
Date: Wed Sep 13 14:26:30 2006
New Revision: 443129

URL: http://svn.apache.org/viewvc?view=rev&rev=443129
Log:
Some additional validation for entity tags

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

Modified: incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/EntityTag.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/EntityTag.java?view=diff&rev=443129&r1=443128&r2=443129
==============================================================================
--- incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/EntityTag.java
(original)
+++ incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/EntityTag.java
Wed Sep 13 14:26:30 2006
@@ -27,8 +27,10 @@
 
   public static EntityTag parse(String entity_tag) {
     if (entity_tag == null || entity_tag.length() == 0) 
-      throw new IllegalArgumentException();    
+      throw new IllegalArgumentException("Invalid Entity Tag");;    
     boolean weak = entity_tag.startsWith("W/");
+    if (!weak && !entity_tag.startsWith("\"")) 
+      throw new IllegalArgumentException("Invalid Entity Tag");
     String tag = entity_tag.substring((weak)?3:1, entity_tag.length() - 1);
     return new EntityTag(tag, weak);
   }



Mime
View raw message