[Fixes #3779] Using explicit StringComparison in startswith
This commit is contained in:
parent
568b061441
commit
dc968bc1bf
|
|
@ -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 == ".")
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue