File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,9 +28,11 @@ let dummy = {
2828 req_id = Uuidm. nil
2929}
3030
31- let add_params req params =
31+ let add_params ?( decode = false ) req params =
3232 let req_params =
3333 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
3436 match StringMap. find_opt arg map with
3537 | Some l0 -> StringMap. add arg (l0 @ l1) map
3638 | None -> StringMap. add arg l1 map
@@ -46,7 +48,7 @@ let request ?(version=`HTTP_1_1) ?(headers=StringMap.empty) ?(time=0.) uri =
4648 let content_type = match StringMap. find_opt " content-type" headers with
4749 | Some (c :: _ ) -> Some c
4850 | _ -> 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)
5052
5153let find_params p req = StringMap. find_opt p.Param. param_id req.req_params
5254
You can’t perform that action at this time.
0 commit comments