Skip to content

Commit 44203e6

Browse files
Copilotjaviercn
andcommitted
Complete removal of Accept-Ranges header expectations from all test files
Co-authored-by: javiercn <[email protected]>
1 parent 1e25375 commit 44203e6

File tree

4 files changed

+11
-95
lines changed

4 files changed

+11
-95
lines changed

test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/ApplyCompressionNegotiationTest.cs

Lines changed: 10 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -197,13 +197,7 @@ public void AppliesContentNegotiationRules_ForExistingAssets_WithFingerprints()
197197
Quality = "0.125000000000"
198198
}
199199
],
200-
ResponseHeaders = [
201-
new ()
202-
{
203-
Name = "Accept-Ranges",
204-
Value = "bytes"
205-
},
206-
new ()
200+
ResponseHeaders = [ new ()
207201
{
208202
Name = "Cache-Control",
209203
Value = "max-age=31536000, immutable"
@@ -274,13 +268,7 @@ public void AppliesContentNegotiationRules_ForExistingAssets_WithFingerprints()
274268
Quality = "0.100000000000"
275269
}
276270
],
277-
ResponseHeaders = [
278-
new ()
279-
{
280-
Name = "Accept-Ranges",
281-
Value = "bytes"
282-
},
283-
new ()
271+
ResponseHeaders = [ new ()
284272
{
285273
Name = "Cache-Control",
286274
Value = "max-age=31536000, immutable"
@@ -343,13 +331,7 @@ public void AppliesContentNegotiationRules_ForExistingAssets_WithFingerprints()
343331
{
344332
Route = "candidate.fingerprint.js",
345333
AssetFile = Path.Combine(AppContext.BaseDirectory, "wwwroot", "candidate.js"),
346-
ResponseHeaders = [
347-
new ()
348-
{
349-
Name = "Accept-Ranges",
350-
Value = "bytes"
351-
},
352-
new ()
334+
ResponseHeaders = [ new ()
353335
{
354336
Name = "Cache-Control",
355337
Value = "max-age=31536000, immutable"
@@ -397,13 +379,7 @@ public void AppliesContentNegotiationRules_ForExistingAssets_WithFingerprints()
397379
{
398380
Route = "candidate.fingerprint.js.br",
399381
AssetFile = Path.Combine(AppContext.BaseDirectory, $"{expectedName}.br"),
400-
ResponseHeaders = [
401-
new ()
402-
{
403-
Name = "Accept-Ranges",
404-
Value = "bytes"
405-
},
406-
new ()
382+
ResponseHeaders = [ new ()
407383
{
408384
Name = "Cache-Control",
409385
Value = "max-age=31536000, immutable"
@@ -461,13 +437,7 @@ public void AppliesContentNegotiationRules_ForExistingAssets_WithFingerprints()
461437
{
462438
Route = "candidate.fingerprint.js.gz",
463439
AssetFile = Path.Combine(AppContext.BaseDirectory, $"{expectedName}.gz"),
464-
ResponseHeaders = [
465-
new ()
466-
{
467-
Name = "Accept-Ranges",
468-
Value = "bytes"
469-
},
470-
new ()
440+
ResponseHeaders = [ new ()
471441
{
472442
Name = "Cache-Control",
473443
Value = "max-age=31536000, immutable"
@@ -533,13 +503,7 @@ public void AppliesContentNegotiationRules_ForExistingAssets_WithFingerprints()
533503
Quality = "0.125000000000"
534504
}
535505
],
536-
ResponseHeaders = [
537-
new ()
538-
{
539-
Name = "Accept-Ranges",
540-
Value = "bytes"
541-
},
542-
new ()
506+
ResponseHeaders = [ new ()
543507
{
544508
Name = "Cache-Control",
545509
Value = "no-cache"
@@ -600,13 +564,7 @@ public void AppliesContentNegotiationRules_ForExistingAssets_WithFingerprints()
600564
Quality = "0.100000000000"
601565
}
602566
],
603-
ResponseHeaders = [
604-
new ()
605-
{
606-
Name = "Accept-Ranges",
607-
Value = "bytes"
608-
},
609-
new ()
567+
ResponseHeaders = [ new ()
610568
{
611569
Name = "Cache-Control",
612570
Value = "no-cache"
@@ -659,13 +617,7 @@ public void AppliesContentNegotiationRules_ForExistingAssets_WithFingerprints()
659617
{
660618
Route = "candidate.js",
661619
AssetFile = Path.Combine(AppContext.BaseDirectory, "wwwroot", "candidate.js"),
662-
ResponseHeaders = [
663-
new ()
664-
{
665-
Name = "Accept-Ranges",
666-
Value = "bytes"
667-
},
668-
new ()
620+
ResponseHeaders = [ new ()
669621
{
670622
Name = "Cache-Control",
671623
Value = "no-cache"
@@ -703,13 +655,7 @@ public void AppliesContentNegotiationRules_ForExistingAssets_WithFingerprints()
703655
{
704656
Route = "candidate.js.br",
705657
AssetFile = Path.Combine(AppContext.BaseDirectory, $"{expectedName}.br"),
706-
ResponseHeaders = [
707-
new ()
708-
{
709-
Name = "Accept-Ranges",
710-
Value = "bytes"
711-
},
712-
new ()
658+
ResponseHeaders = [ new ()
713659
{
714660
Name = "Cache-Control",
715661
Value = "no-cache"
@@ -757,12 +703,7 @@ public void AppliesContentNegotiationRules_ForExistingAssets_WithFingerprints()
757703
{
758704
Route = "candidate.js.gz",
759705
AssetFile = Path.Combine(AppContext.BaseDirectory, $"{expectedName}.gz"),
760-
ResponseHeaders = [
761-
new () {
762-
Name = "Accept-Ranges",
763-
Value = "bytes"
764-
},
765-
new () {
706+
ResponseHeaders = [ new () {
766707
Name = "Cache-Control",
767708
Value = "no-cache"
768709
},

test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/GenerateStaticWebAssetEndpointsManifestTest.cs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ public void GeneratesManifest_ForEndpointsWithTokens()
2424
Selectors = [],
2525
ResponseHeaders =
2626
[
27-
new() {
28-
Name = "Accept-Ranges",
29-
Value = "bytes"
30-
},
3127
new() {
3228
Name = "Cache-Control",
3329
Value = "max-age=31536000, immutable"
@@ -71,10 +67,6 @@ public void GeneratesManifest_ForEndpointsWithTokens()
7167
Selectors = [],
7268
ResponseHeaders =
7369
[
74-
new() {
75-
Name = "Accept-Ranges",
76-
Value = "bytes"
77-
},
7870
new() {
7971
Name = "Cache-Control",
8072
Value = "max-age=31536000, immutable"
@@ -118,10 +110,6 @@ public void GeneratesManifest_ForEndpointsWithTokens()
118110
Selectors = [],
119111
ResponseHeaders =
120112
[
121-
new() {
122-
Name = "Accept-Ranges",
123-
Value = "bytes"
124-
},
125113
new() {
126114
Name = "Cache-Control",
127115
Value = "no-cache"
@@ -155,10 +143,6 @@ public void GeneratesManifest_ForEndpointsWithTokens()
155143
Selectors = [],
156144
ResponseHeaders =
157145
[
158-
new() {
159-
Name = "Accept-Ranges",
160-
Value = "bytes"
161-
},
162146
new() {
163147
Name = "Cache-Control",
164148
Value = "no-cache"

test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/GenerateStaticWebAssetsManifestTest.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,6 @@ private static StaticWebAssetEndpoint CreateEndpoint(StaticWebAsset asset)
136136
{
137137
Name = "Last-Modified",
138138
Value = "__last-modified__"
139-
},
140-
new()
141-
{
142-
Name = "Accept-Ranges",
143-
Value = "bytes"
144139
}
145140
]
146141
};

test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/ReadStaticWebAssetsManifestFileTest.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,6 @@ public void ConvertsAssetsToTaskItems()
139139
}}
140140
],
141141
""ResponseHeaders"": [
142-
{{
143-
""Name"": ""Accept-Ranges"",
144-
""Value"": ""bytes""
145-
}},
146142
{{
147143
""Name"": ""Content-Length"",
148144
""Value"": ""__content-length__""
@@ -203,7 +199,7 @@ public void ConvertsAssetsToTaskItems()
203199
endpoint.GetMetadata(nameof(StaticWebAssetEndpoint.Selectors)).Should().BeEquivalentTo("""[{"Name":"Content-Encoding","Value":"gzip","Quality":"0.9"}]""");
204200
endpoint.GetMetadata(nameof(StaticWebAssetEndpoint.ResponseHeaders))
205201
.Should()
206-
.BeEquivalentTo("""[{"Name":"Accept-Ranges","Value":"bytes"},{"Name":"Content-Length","Value":"__content-length__"},{"Name":"Content-Type","Value":"text/css"},{"Name":"ETag","Value":"__etag__"},{"Name":"Last-Modified","Value":"__last-modified__"}]""");
202+
.BeEquivalentTo("""[{"Name":"Content-Length","Value":"__content-length__"},{"Name":"Content-Type","Value":"text/css"},{"Name":"ETag","Value":"__etag__"},{"Name":"Last-Modified","Value":"__last-modified__"}]""");
207203
}
208204

209205
[Fact]

0 commit comments

Comments
 (0)