Skip to content

Commit

Permalink
Always percent-escape semicolon in structured query encoding.
Browse files Browse the repository at this point in the history
  • Loading branch information
dsheets committed Apr 28, 2014
1 parent 777aa38 commit f107304
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/uri.ml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ module Generic : Scheme = struct
(* '&' is safe but we should encode literals to avoid ambiguity
with the already parsed qs params *)
a.(Char.code '&') <- false;
a.(Char.code ';') <- false;
a.(Char.code '+') <- false;
a

Expand Down
2 changes: 2 additions & 0 deletions lib_test/test_runner.ml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ let uri_query_make = [
["foo1",["bar1"];"foo2",["bar2"]], "foo1=bar1&foo2=bar2";
["foo1",["bar1"];"foo2",["bar2"];"foo3",["bar3"]],
"foo1=bar1&foo2=bar2&foo3=bar3";
["semicolon",[";"]],"semicolon=%3B";
[";",["semicolon"]],"%3B=semicolon";
["#",["#";"#"]], "%23=%23,%23";
["",[]], "";
["",[""]], "=";
Expand Down

1 comment on commit f107304

@avsm
Copy link

@avsm avsm commented on f107304 Apr 28, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

two steps forward, one step back, that's a win in my book!

Please sign in to comment.