Update static files to use strong comparison on ETags
This commit is contained in:
parent
33dbd6d78b
commit
a4d2e5ebcd
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<packageSources>
|
<packageSources>
|
||||||
<add key="AspNetVNext" value="https://www.myget.org/F/aspnetcidev/api/v3/index.json" />
|
<add key="AspNetCore" value="https://dotnet.myget.org/F/aspnetcore-ci-dev/api/v3/index.json" />
|
||||||
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
|
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
|
||||||
</packageSources>
|
</packageSources>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|
@ -173,7 +173,7 @@ namespace Microsoft.AspNetCore.StaticFiles
|
||||||
_ifMatchState = PreconditionState.PreconditionFailed;
|
_ifMatchState = PreconditionState.PreconditionFailed;
|
||||||
foreach (var etag in ifMatch)
|
foreach (var etag in ifMatch)
|
||||||
{
|
{
|
||||||
if (etag.Equals(EntityTagHeaderValue.Any) || etag.Equals(_etag))
|
if (etag.Equals(EntityTagHeaderValue.Any) || etag.Compare(_etag, useStrongComparison: true))
|
||||||
{
|
{
|
||||||
_ifMatchState = PreconditionState.ShouldProcess;
|
_ifMatchState = PreconditionState.ShouldProcess;
|
||||||
break;
|
break;
|
||||||
|
|
@ -188,7 +188,7 @@ namespace Microsoft.AspNetCore.StaticFiles
|
||||||
_ifNoneMatchState = PreconditionState.ShouldProcess;
|
_ifNoneMatchState = PreconditionState.ShouldProcess;
|
||||||
foreach (var etag in ifNoneMatch)
|
foreach (var etag in ifNoneMatch)
|
||||||
{
|
{
|
||||||
if (etag.Equals(EntityTagHeaderValue.Any) || etag.Equals(_etag))
|
if (etag.Equals(EntityTagHeaderValue.Any) || etag.Compare(_etag, useStrongComparison: true))
|
||||||
{
|
{
|
||||||
_ifNoneMatchState = PreconditionState.NotModified;
|
_ifNoneMatchState = PreconditionState.NotModified;
|
||||||
break;
|
break;
|
||||||
|
|
@ -273,7 +273,7 @@ namespace Microsoft.AspNetCore.StaticFiles
|
||||||
ignoreRangeHeader = true;
|
ignoreRangeHeader = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (ifRangeHeader.EntityTag != null && !_etag.Equals(ifRangeHeader.EntityTag))
|
else if (ifRangeHeader.EntityTag != null && !ifRangeHeader.EntityTag.Compare(_etag, useStrongComparison: true))
|
||||||
{
|
{
|
||||||
ignoreRangeHeader = true;
|
ignoreRangeHeader = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue