Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/uri.ml
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ module Parser = struct
let scheme =
lift
(fun s -> Some (Pct.decode (Pct.cast_encoded s)))
(take_while (fun c -> c <> ':' && c <> '/' && c <> '?' && c <> '#')
(take_while (fun c -> c <> '@' && c <> ':' && c <> '/' && c <> '?' && c <> '#')
<* char ':')
<|> return None

Expand Down
3 changes: 3 additions & 0 deletions lib_test/test_runner.ml
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,9 @@ let test_with_change = [
let urn = Uri.of_string "urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6" in
let urn2= Uri.with_scheme urn (Some "urn") in
assert_equal ~printer urn urn2;
let git = Uri.of_string "[email protected]:owner/repo" in
let pp_option pp ppf = function Some x -> Format.fprintf ppf "%a" pp x | None -> () in
assert_equal ~printer:(Format.asprintf "%a" (pp_option Format.pp_print_string)) (Uri.scheme git) None ;

let urn_path =
Uri.with_path Uri.empty "uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6"
Expand Down