I believe the behaviour of Uri.path is wrong when it is passed a Uri beginning with exactly two slashes. In such case, it drops everything before the third slash
#require "uri-sexp";;
utop # "aaa/bbb" |> Uri.of_string |> Uri.path;;
- : string = "aaa/bbb"
utop # "/aaa/bbb" |> Uri.of_string |> Uri.path;;
- : string = "/aaa/bbb"
utop # "//aaa/bbb" |> Uri.of_string |> Uri.path;; (* Boom! *)
- : string = "/bbb"
utop # "///aaa/bbb" |> Uri.of_string |> Uri.path;;
- : string = "/aaa/bbb"
I believe the behaviour of
Uri.pathis wrong when it is passed a Uri beginning with exactly two slashes. In such case, it drops everything before the third slash