Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fixed a problem duplicated relativePath
  • Loading branch information
yamachu committed Dec 13, 2016
commit 9d250f6bb08ba223dbd8eccc67af9c7ce2472673
8 changes: 6 additions & 2 deletions src/React.AspNet/AspNetFileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,12 @@ public AspNetFileSystem(IHostingEnvironment hostingEnv)
/// <returns>Full path of the file</returns>
public override string MapPath(string relativePath)
{
relativePath = relativePath.TrimStart('~').TrimStart('/');
return Path.Combine(_hostingEnv.WebRootPath, relativePath);
if (relativePath.StartsWith(_hostingEnv.WebRootPath))
{
return relativePath;
}
relativePath = relativePath.TrimStart('~').TrimStart('/');
return Path.Combine(_hostingEnv.WebRootPath, relativePath);
}
}
}