Skip to content

Commit cef84b0

Browse files
yamachuDaniel15
authored andcommitted
Fixed a problem duplicated relativePath (#359)
1 parent 2092309 commit cef84b0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/React.AspNet/AspNetFileSystem.cs

+6-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,12 @@ public AspNetFileSystem(IHostingEnvironment hostingEnv)
3636
/// <returns>Full path of the file</returns>
3737
public override string MapPath(string relativePath)
3838
{
39-
relativePath = relativePath.TrimStart('~').TrimStart('/');
40-
return Path.Combine(_hostingEnv.WebRootPath, relativePath);
39+
if (relativePath.StartsWith(_hostingEnv.WebRootPath))
40+
{
41+
return relativePath;
42+
}
43+
relativePath = relativePath.TrimStart('~').TrimStart('/');
44+
return Path.Combine(_hostingEnv.WebRootPath, relativePath);
4145
}
4246
}
4347
}

0 commit comments

Comments
 (0)