[Fixes #3779] Using explicit StringComparison in startswith

This commit is contained in:
Ajay Bhargav Baaskaran 2015-12-31 11:20:06 -08:00
parent 568b061441
commit dc968bc1bf
2 changed files with 2 additions and 2 deletions

View File

@ -90,7 +90,7 @@ namespace Microsoft.AspNet.Mvc.Formatters
throw new ArgumentException(Resources.ArgumentCannotBeNullOrEmpty, nameof(format));
}
if (format.StartsWith("."))
if (format.StartsWith(".", StringComparison.Ordinal))
{
if (format == ".")
{

View File

@ -97,7 +97,7 @@ namespace Microsoft.AspNet.Mvc
var fileProvider = GetFileProvider(response.HttpContext.RequestServices);
var normalizedPath = FileName;
if (normalizedPath.StartsWith("~"))
if (normalizedPath.StartsWith("~", StringComparison.Ordinal))
{
normalizedPath = normalizedPath.Substring(1);
}