mlrgoh / missing-link

Automatically exported from code.google.com/p/missing-link
0 stars 0 forks source link

HttpClientBuilder fails to parse URI containing full stops in folder names or files #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The problem lies in the URL_REGEX used by HttpClientBuilder to parse the URI

http://myserver:8081/artifactory/libs-snapshots-local/myjar/138-SNAPSHOT/myjar-1
38-SNAPSHOT.jar is accepted

http://myserver:8081/artifactory/libs-releases-local/myjar/138.0/myjar-138.0.jar
 is NOT accepted, it is incorrectly parsed as 
http://myserver:8081/artifactory/libs-releases-local/myjar/138.0/myjar-138?.0.ja
r (note the question mark)

This is a nasty bug made even worse by Issue 15. 

java.net.URI is not perfect by any means, but even so I don't understand why 
Missing Link needs to reparse the URI for itself. Surely java.net.URI can take 
care of any encoding issues, and regex matching will not be necessary

Original issue reported on code.google.com by stephens...@googlemail.com on 27 May 2011 at 11:20

GoogleCodeExporter commented 9 years ago
Attached is a patch for HttpClientBuilder that uses java.net.URI rather than a 
regex. I've replaced the concepts of "context" and "extension" with simply 
using "path".

java.net.URI doesn't allow unencoded parameters to be specified but does allow 
unknown protocol schemes to be specified, so I've put in a workaround for each 
issue.

Original comment by stephens...@googlemail.com on 27 May 2011 at 1:54

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by alex.she...@gmail.com on 23 Jul 2011 at 3:33

GoogleCodeExporter commented 9 years ago

Original comment by alex.she...@gmail.com on 23 Jul 2011 at 3:33

GoogleCodeExporter commented 9 years ago
Applied user submitted patch which changed how the URI is parsed to be safer, 
alleviates problems with the URL_REGEX pattern that was originally used

Original comment by alex.she...@gmail.com on 23 Jul 2011 at 3:33

GoogleCodeExporter commented 9 years ago

Original comment by alex.she...@gmail.com on 23 Jul 2011 at 3:44

GoogleCodeExporter commented 9 years ago

Original comment by alex.she...@gmail.com on 19 Aug 2011 at 12:51