-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disallow @ on scheme part #155
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sounds like adding support for the "scp syntax" to the library. Perhaps this should be documented somewhere ?
a remote host with optional path in the form [user@]host:[path]
Git calls it "scp-like syntax": https://git-scm.com/docs/git-clone#_git_urls but with a special case:
This syntax is only recognized if there are no slashes before the first colon. This helps differentiate a local path that contains a colon
lib_test/test_runner.ml
Outdated
@@ -422,6 +422,8 @@ 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 "git@github.com:owner/repo" in | |||
assert_equal ~printer:Fmt.(to_to_string (option string)) (Uri.scheme git) None ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path of user@host:50/repo
should be 50/repo
. Can you add a test to make sure it isn't picked as the port number ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would indeed allow me to use it in dune-release !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All information move as a path
part of the given Uri.t
. Again, this PR does not want to fix your initial issue but it wants to respect a little better the RFC (and disallow @
as a possible character of the scheme part). If you really want to accept and understand something like git@github.com:owner/repo
, you should take a look on emile
- with a split on :
- which one best fits your case.
A simple fix to disallow
@
on scheme according to RFC 3986. We need aREVDEP
to be sure to not break anything.