From f107304791d0dac52e861a907ea962ddd95366d7 Mon Sep 17 00:00:00 2001 From: David Sheets Date: Mon, 28 Apr 2014 15:48:39 +0100 Subject: [PATCH] Always percent-escape semicolon in structured query encoding. Fixes mirage/ocaml-cohttp#126. Fixes mirage/ocaml-uri#42. Creates mirage/ocaml-uri#43. --- lib/uri.ml | 1 + lib_test/test_runner.ml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/lib/uri.ml b/lib/uri.ml index 02f93dd..e1e0155 100644 --- a/lib/uri.ml +++ b/lib/uri.ml @@ -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 diff --git a/lib_test/test_runner.ml b/lib_test/test_runner.ml index 79a6328..229cb1a 100644 --- a/lib_test/test_runner.ml +++ b/lib_test/test_runner.ml @@ -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"; ["",[]], ""; ["",[""]], "=";