We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2092309 commit cef84b0Copy full SHA for cef84b0
src/React.AspNet/AspNetFileSystem.cs
@@ -36,8 +36,12 @@ public AspNetFileSystem(IHostingEnvironment hostingEnv)
36
/// <returns>Full path of the file</returns>
37
public override string MapPath(string relativePath)
38
{
39
- relativePath = relativePath.TrimStart('~').TrimStart('/');
40
- return Path.Combine(_hostingEnv.WebRootPath, relativePath);
+ if (relativePath.StartsWith(_hostingEnv.WebRootPath))
+ {
41
+ return relativePath;
42
+ }
43
+ relativePath = relativePath.TrimStart('~').TrimStart('/');
44
+ return Path.Combine(_hostingEnv.WebRootPath, relativePath);
45
}
46
47
0 commit comments