Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 315571 - URIish accepts incorrect URIs
Summary: URIish accepts incorrect URIs
Status: RESOLVED FIXED
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.0.0   Edit
Assignee: Christian Halstrick CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-03 08:39 EDT by Dmitry Neverov CLA
Modified: 2010-10-08 05:14 EDT (History)
2 users (show)

See Also:


Attachments
test to reproduce the problem (913 bytes, patch)
2010-06-03 08:39 EDT, Dmitry Neverov CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Neverov CLA 2010-06-03 08:39:15 EDT
URIish currently accept incorrect git URIs and parse whem a little bit wrong. 

For exaple, URIish accepts incorrect URI "ssh://some-host:/path/to/repository.git". It is incorrect because of redundant ':' after the host. 

After that getHost() method returns:

"some-hos"

and getPath() method returns:

"t:/path/to/repository.git".

Test to reproduce the bug is attached.
Comment 1 Dmitry Neverov CLA 2010-06-03 08:39:39 EDT
Created attachment 170944 [details]
test to reproduce the problem
Comment 2 Christian Halstrick CLA 2010-10-01 03:38:07 EDT
I try to fix this with http://egit.eclipse.org/r/#change,1690.

I solved one thing differently. I cannot come up with a URISyntaxException because the syntax is not so bad as we both think. URI's are mainly a scheme, a colon and then a scheme specific part (which can be nearly anything). Not the generic URIish parsing but the ssh specific code can tell that the URI is wrong. So, in my proposal the URI parsing will go through but calling the various "...canHandle()" methods in our transport framework will fail.
Comment 3 Matthias Sohn CLA 2010-10-08 05:14:14 EDT
merged as 2160c09dd4f678c5f2f8e730945be637210b39de