Some Test:
This is Ture:
[Fact]
public void UriEqualTest()
{
//Act
var uri1 = new Uri("https://www.baidu.com");
var uri2 = new Uri("https://www.baidu.com/");
var boolResult = uri2.Equals(uri1);
//Assert
Assert.Equal(uri1, uri2);
Assert.True(boolResult);//True
}
This is Ture:
[Fact]
public void UriUpperEqualTest()
{
//Act
var uri1 = new Uri("https://wWw.bAidu.com");
var uri2 = new Uri("https://www.baidu.com/");
var boolResult = uri2.Equals(uri1);
var operatorResult = (uri1 == uri2);
//Assert
Assert.Equal(uri1, uri2);
Assert.True(boolResult);//True
}
This is False:
[Fact]
public void UrlEqualTest()
{
//Act
var uri1 = new Uri("https://www.baidu.com/aaaa/bbbb");
var uri2 = new Uri("https://www.baidu.com/aaaa/bbbb/");
var boolResult = uri2.Equals(uri1);
//Assert
Assert.Equal(uri1, uri2);
Assert.True(boolResult);//False
}
This is False:
[Fact]
public void UrlUpperEqualTest()
{
//Act
var uri1 = new Uri("https://www.baidu.com/AAaa/bbbb");
var uri2 = new Uri("https://www.baidu.com/aAAa/bbbb");
var boolResult = uri2.Equals(uri1);
var operatorResult = (uri1 == uri2);
//Assert
Assert.Equal(uri1, uri2);
Assert.True(boolResult);//False
}
This is True:
[Fact]
public void UriUpperEqualAndPathTest()
{
//Act
var uri1 = new Uri("https://www.baiDu.com/aaaa/bbbb");
var uri2 = new Uri("https://www.Baidu.com/aaaa/bbbb");
var boolResult = uri2.Equals(uri1);
//Assert
Assert.Equal(uri1, uri2);
Assert.True(boolResult);//True
}
So,The Host not case sensitive? but path case sensitive??
And I want all Uri dot not case sensitive and dot not case '/',What should I do?
And I want all Uri dot not case sensitive and dot not case '/',What should I do?
And I want all Uri dot not case sensitive and dot not case '/',What should I do?
And in aspnet core mvc, if i use route
[HttpGet("/private/head")] and [HttpGet("/private/HeAd")] and [HttpGet("/private/head/")]
It's error! the error is:
AmbiguousActionException: Multiple actions matched. The following actions matched route data and had all constraints satisfied: