File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -28,9 +28,11 @@ let dummy = {
28
28
req_id = Uuidm. nil
29
29
}
30
30
31
- let add_params req params =
31
+ let add_params ?( decode = false ) req params =
32
32
let req_params =
33
33
List. fold_left (fun map (arg , l1 ) ->
34
+ let arg = if decode then Url. decode arg else arg in
35
+ let l1 = if decode then List. map Url. decode l1 else l1 in
34
36
match StringMap. find_opt arg map with
35
37
| Some l0 -> StringMap. add arg (l0 @ l1) map
36
38
| None -> StringMap. add arg l1 map
@@ -46,7 +48,7 @@ let request ?(version=`HTTP_1_1) ?(headers=StringMap.empty) ?(time=0.) uri =
46
48
let content_type = match StringMap. find_opt " content-type" headers with
47
49
| Some (c :: _ ) -> Some c
48
50
| _ -> None in
49
- path_str, path, content_type, add_params req (Uri. query uri)
51
+ path_str, path, content_type, add_params ~decode: true req (Uri. query uri)
50
52
51
53
let find_params p req = StringMap. find_opt p.Param. param_id req.req_params
52
54
You can’t perform that action at this time.
0 commit comments