Skip to content
This repository was archived by the owner on Nov 22, 2018. It is now read-only.

Commit a4d2e5e

Browse files
committed
Update static files to use strong comparison on ETags
1 parent 33dbd6d commit a4d2e5e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

NuGet.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<packageSources>
4-
<add key="AspNetVNext" value="https://www.myget.org/F/aspnetcidev/api/v3/index.json" />
4+
<add key="AspNetCore" value="https://dotnet.myget.org/F/aspnetcore-ci-dev/api/v3/index.json" />
55
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
66
</packageSources>
77
</configuration>

src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ private void ComputeIfMatch()
173173
_ifMatchState = PreconditionState.PreconditionFailed;
174174
foreach (var etag in ifMatch)
175175
{
176-
if (etag.Equals(EntityTagHeaderValue.Any) || etag.Equals(_etag))
176+
if (etag.Equals(EntityTagHeaderValue.Any) || etag.Compare(_etag, useStrongComparison: true))
177177
{
178178
_ifMatchState = PreconditionState.ShouldProcess;
179179
break;
@@ -188,7 +188,7 @@ private void ComputeIfMatch()
188188
_ifNoneMatchState = PreconditionState.ShouldProcess;
189189
foreach (var etag in ifNoneMatch)
190190
{
191-
if (etag.Equals(EntityTagHeaderValue.Any) || etag.Equals(_etag))
191+
if (etag.Equals(EntityTagHeaderValue.Any) || etag.Compare(_etag, useStrongComparison: true))
192192
{
193193
_ifNoneMatchState = PreconditionState.NotModified;
194194
break;
@@ -273,7 +273,7 @@ private void ComputeRange()
273273
ignoreRangeHeader = true;
274274
}
275275
}
276-
else if (ifRangeHeader.EntityTag != null && !_etag.Equals(ifRangeHeader.EntityTag))
276+
else if (ifRangeHeader.EntityTag != null && !ifRangeHeader.EntityTag.Compare(_etag, useStrongComparison: true))
277277
{
278278
ignoreRangeHeader = true;
279279
}

0 commit comments

Comments
 (0)