File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
src/UmbracoFileSystemProviders.Azure Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -572,16 +572,21 @@ private CloudBlobDirectory GetDirectoryReference(string path)
572572 private string ResolveUrl ( string path , bool relative )
573573 {
574574 // First create the full url
575- Uri url = new Uri ( new Uri ( this . rootUrl , UriKind . Absolute ) , this . FixPath ( path ) ) ;
575+ string fixedPath = this . FixPath ( path ) ;
576+
577+ Uri url = new Uri ( new Uri ( this . rootUrl , UriKind . Absolute ) , fixedPath ) ;
576578
577579 if ( ! relative )
578580 {
579581 return url . AbsoluteUri ;
580582 }
581583
582- int index = url . AbsolutePath . IndexOf ( this . ContainerName , StringComparison . Ordinal ) - 1 ;
583- string relativePath = url . AbsolutePath . Substring ( index ) ;
584- return relativePath ;
584+ if ( this . UseDefaultRoute )
585+ {
586+ return string . Format ( "/{0}/{1}" , Constants . DefaultMediaRoute , fixedPath ) ;
587+ }
588+
589+ return string . Format ( "/{0}/{1}" , this . ContainerName , fixedPath ) ;
585590 }
586591
587592 /// <summary>
You can’t perform that action at this time.
0 commit comments