Bug 12631 - Uri.TryCreate return local path instead of correct Uri
Summary: Uri.TryCreate return local path instead of correct Uri
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: System ()
Version: unspecified
Hardware: PC Linux
: Normal normal
Target Milestone: Untriaged
Assignee: Martin Baulig
URL:
Depends on:
Blocks:
 
Reported: 2013-06-11 09:19 UTC by Matteo Fabbri
Modified: 2013-06-24 13:03 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Matteo Fabbri 2013-06-11 09:19:17 UTC
Description of Problem:

On Linux the Uri.TryCreate method ignore the given base uri and read the relative string as a local linux path

Steps to reproduce the problem:

var mainUri = new Uri("http://www.imdb.com");
var uriPath = "/title/tt0106521";

Uri result;
if(Uri.TryCreate(mainUri, uriPath, out result))
Console.WriteLine(result.ToString());


Actual Results:
file:///title/tt0106521

Expected Results:
http://www.imdb.com/title/tt0106521

How often does this happen? 
Always

Additional Information:

SO: Ubuntu 13.04 (GNU/Linux 3.8.13-xxxx-grs-ipv6-64 x86_64)
Comment 1 Rodrigo Kumpera 2013-06-17 14:43:10 UTC
Hey Martin,

Could you take a look at this one?

Thanks,
Rodrigo
Comment 2 Martin Baulig 2013-06-24 13:03:28 UTC
This is working fine for me with Mono 3.0.12.  I added a test case for it.