adds notes
This commit is contained in:
@@ -55,9 +55,15 @@ namespace Umbraco.Web
|
||||
{
|
||||
if (virtualPath.InvariantStartsWith(_appPathPrefix)
|
||||
&& (virtualPath.Length == _appPathPrefix.Length || virtualPath[_appPathPrefix.Length] == '/'))
|
||||
{
|
||||
virtualPath = virtualPath.Substring(_appPathPrefix.Length);
|
||||
}
|
||||
|
||||
if (virtualPath.Length == 0)
|
||||
{
|
||||
virtualPath = "/";
|
||||
}
|
||||
|
||||
return virtualPath;
|
||||
}
|
||||
|
||||
@@ -88,9 +94,8 @@ namespace Umbraco.Web
|
||||
// ie no virtual directory, no .aspx, lowercase...
|
||||
public Uri UriToUmbraco(Uri uri)
|
||||
{
|
||||
// TODO: Ideally we do this witout so many string allocations, we can use
|
||||
// techniques like StringSegment and Span. This is critical code that executes on every request.
|
||||
// not really sure we need ToLower.
|
||||
// TODO: This is critical code that executes on every request, we should
|
||||
// look into if all of this is necessary? not really sure we need ToLower?
|
||||
|
||||
// note: no need to decode uri here because we're returning a uri
|
||||
// so it will be re-encoded anyway
|
||||
|
||||
@@ -67,6 +67,8 @@ namespace Umbraco.Core
|
||||
|
||||
// cannot get .AbsolutePath on relative uri (InvalidOperation)
|
||||
var s = uri.OriginalString;
|
||||
|
||||
// TODO: Shouldn't this just use Uri.GetLeftPart?
|
||||
var posq = s.IndexOf("?", StringComparison.Ordinal);
|
||||
var posf = s.IndexOf("#", StringComparison.Ordinal);
|
||||
var pos = posq > 0 ? posq : (posf > 0 ? posf : 0);
|
||||
|
||||
Reference in New Issue
Block a user