Permalink
Browse files

URL encode the since parameter for bigcouch

  • Loading branch information...
1 parent ed0aa35 commit 44f0ad54b494adf4faed1641b806913bbdbe9356 Robert Newson committed Apr 26, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/main/java/com/github/rnewson/couchdb/lucene/couchdb/UpdateSequence.java
@@ -1,5 +1,7 @@
package com.github.rnewson.couchdb.lucene.couchdb;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
@@ -50,7 +52,11 @@ private BigCouchUpdateSequence(final String encodedVector, final String packedSe
@Override
public String appendSince(final String url) {
- return url + "&since=" + since;
+ try {
+ return url + "&since=" + URLEncoder.encode(since, "US-ASCII");
+ } catch (UnsupportedEncodingException e) {
+ throw new Error("US-ASCII inexplicably missing.");
+ }
}
@Override

0 comments on commit 44f0ad5

Please sign in to comment.