File tree Expand file tree Collapse file tree
tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -111,6 +111,12 @@ public Uri UriToUmbraco(Uri uri)
111111 if ( path != "/" )
112112 {
113113 path = path . TrimEnd ( Constants . CharArrays . ForwardSlash ) ;
114+
115+ // perform fallback to root if the path was all slashes (i.e. https://some.where//////)
116+ if ( path == string . Empty )
117+ {
118+ path = "/" ;
119+ }
114120 }
115121
116122 return uri . Rewrite ( path ) ;
Original file line number Diff line number Diff line change @@ -23,7 +23,9 @@ public class UriUtilityTests
2323
2424 // test that the trailing slash goes but not on hostname
2525 [ TestCase ( "http://LocalHost/" , "http://localhost/" ) ]
26+ [ TestCase ( "http://LocalHost/////" , "http://localhost/" ) ]
2627 [ TestCase ( "http://LocalHost/Home/" , "http://localhost/home" ) ]
28+ [ TestCase ( "http://LocalHost/Home/////" , "http://localhost/home" ) ]
2729 [ TestCase ( "http://LocalHost/Home/?x=y" , "http://localhost/home?x=y" ) ]
2830 [ TestCase ( "http://LocalHost/Home/Sub1/" , "http://localhost/home/sub1" ) ]
2931 [ TestCase ( "http://LocalHost/Home/Sub1/?x=y" , "http://localhost/home/sub1?x=y" ) ]
You can’t perform that action at this time.
0 commit comments