Skip to content

Commit

Permalink
allow '=' in query parameter value
Browse files Browse the repository at this point in the history
  • Loading branch information
Ananya Saxena authored and mattwhisenhunt committed Feb 15, 2018
1 parent 943aa99 commit 356bf78
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,13 @@ public static void parse(Reader reader, Object data) throws IOException {
}
break;
case '=':
// finished with name, now read value
readingName = false;
if (readingName) {
// finished with name, now read value
readingName = false;
} else {
// '=' is in the value
valueWriter.write(read);
}
break;
default:
// read one more character
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ public Generic set(String fieldName, Object value) {
public void testParse_simple() {
Simple actual = new Simple();
UrlEncodedParser.parse(
"v=ignore&v=ignore2&q=1&a=x&b=y&c=z&q=2&undeclared=0&o=object&r=a1&r=a2", actual);
"v=ignore&v=ignore2&q=1&a=x=&b=y&c=z&q=2&undeclared=0&o=object&r=a1&r=a2", actual);
Simple expected = new Simple();
expected.a = "x";
expected.a = "x=";
expected.b = "y";
expected.c = "z";
expected.q = new ArrayList<String>(Arrays.asList("1", "2"));
Expand Down

0 comments on commit 356bf78

Please sign in to comment.