Skip to content

Commit 63f9d84

Browse files
author
David Scott
committed
Avoid parsing and printing URIs from the backends
This avoids tripping up if Uri.(to_string (of_string x)) <> x from the point-of-view of the backend. Signed-off-by: David Scott <[email protected]>
1 parent 5686c70 commit 63f9d84

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

main.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ let choose_datapath ?(persistent = true) response =
227227
let uri = Uri.of_string x in
228228
match Uri.scheme uri with
229229
| None -> None
230-
| Some scheme -> Some (scheme, uri)
230+
| Some scheme -> Some (scheme, x)
231231
) response.Storage.Volume.Types.uri in
232232
(* We can only use URIs whose schemes correspond to registered plugins *)
233233
let possible = List.filter ~f:(fun (scheme, _) -> Hashtbl.mem !Datapath_plugins.table scheme) possible in
@@ -243,7 +243,7 @@ let choose_datapath ?(persistent = true) response =
243243
supports_nonpersistent @ others in
244244
match preference_order with
245245
| [] -> return (Error (missing_uri ()))
246-
| (scheme, u) :: us -> return (Ok (scheme, Uri.to_string u, "0"))
246+
| (scheme, u) :: us -> return (Ok (scheme, u, "0"))
247247

248248
(* Process a message *)
249249
let process root_dir name x =

0 commit comments

Comments
 (0)