Skip to content

Commit

Permalink
added double and triple validation to rev.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnorthrup committed Jun 2, 2012
1 parent 6be2422 commit 1a8e77d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion rxf-server/src/main/java/rxf/server/DbKeys.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,16 @@
enum etype {

opaque, db, docId, rev {
/**
* couchdb only returns a quoted etag for entities. this quoted etag breaks in queries sent back to couchdb as rev="breakage"
* @param data
* @param <T>
* @return
*/
@Override
<T> boolean validate(T... data) {
return data[0].toString().length() > 0;
final String t = (String) data[0];
return t.toString().length() > 0 && !t.startsWith("\"") && !t.endsWith("\"");
}
}, designDocId, view, validjson, mimetype {{
clazz = MimeType.class;
Expand Down

0 comments on commit 1a8e77d

Please sign in to comment.