241 writes to Name
Microsoft.NET.Sdk.StaticWebAssets.Tasks (13)
ApplyCompressionNegotiation.cs (5)
91
Name
= "Vary",
146
Name
= "Vary",
226
Name
= "Content-Encoding",
231
Name
= "Vary",
409
Name
= "ETag",
DefineStaticWebAssetEndpoints.cs (6)
132
Name
= "Content-Length",
137
Name
= "Content-Type",
142
Name
= "ETag",
147
Name
= "Last-Modified",
157
headers[4] = new() {
Name
= "Cache-Control", Value = "max-age=31536000, immutable" };
164
headers[4] = new() {
Name
= "Cache-Control", Value = !string.IsNullOrEmpty(cacheSetting) ? cacheSetting : "no-cache" };
UpdateStaticWebAssetEndpoints.cs (2)
224
(name, value) => new StaticWebAssetEndpointResponseHeader {
Name
= name, Value = value },
331
Name
= operation.Name,
Microsoft.NET.Sdk.StaticWebAssets.Tests (228)
StaticWebAssets\ApplyCompressionNegotiationTest.cs (166)
83
new () {
Name
= "Content-Encoding", Value = "gzip" },
84
new () {
Name
= "Content-Length", Value = "9" },
85
new () {
Name
= "Content-Type", Value = "text/javascript" },
86
new () {
Name
= "Vary", Value = "Accept-Encoding" }
97
new () {
Name
= "Content-Length", Value = "20" },
98
new () {
Name
= "Content-Type", Value = "text/javascript" },
99
new () {
Name
= "Vary", Value = "Accept-Encoding" },
110
new () {
Name
= "Content-Encoding", Value = "gzip" },
111
new () {
Name
= "Content-Length", Value = "9" },
112
new () {
Name
= "Content-Type", Value = "text/javascript" },
113
new () {
Name
= "Vary", Value = "Accept-Encoding" }
203
Name
= "Cache-Control",
208
Name
= "Content-Encoding",
213
Name
= "Content-Length",
218
Name
= "Content-Type",
223
Name
= "ETag",
228
Name
= "Last-Modified",
233
Name
= "Vary",
269
Name
= "Cache-Control",
274
Name
= "Content-Encoding",
279
Name
= "Content-Length",
284
Name
= "Content-Type",
289
Name
= "ETag",
294
Name
= "Last-Modified",
299
Name
= "Vary",
327
Name
= "Cache-Control",
332
Name
= "Content-Length",
337
Name
= "Content-Type",
342
Name
= "ETag",
347
Name
= "Last-Modified",
352
Name
= "Vary",
380
Name
= "Cache-Control",
385
Name
= "Content-Encoding",
390
Name
= "Content-Length",
395
Name
= "Content-Type",
400
Name
= "ETag",
405
Name
= "Last-Modified",
410
Name
= "Vary",
438
Name
= "Cache-Control",
443
Name
= "Content-Encoding",
448
Name
= "Content-Length",
453
Name
= "Content-Type",
458
Name
= "ETag",
463
Name
= "Last-Modified",
468
Name
= "Vary",
504
Name
= "Cache-Control",
509
Name
= "Content-Encoding",
514
Name
= "Content-Length",
519
Name
= "Content-Type",
524
Name
= "ETag",
529
Name
= "Last-Modified",
534
Name
= "Vary",
560
Name
= "Cache-Control",
565
Name
= "Content-Encoding",
570
Name
= "Content-Length",
575
Name
= "Content-Type",
580
Name
= "ETag",
585
Name
= "Last-Modified",
590
Name
= "Vary",
608
Name
= "Cache-Control",
613
Name
= "Content-Length",
618
Name
= "Content-Type",
623
Name
= "ETag",
628
Name
= "Last-Modified",
633
Name
= "Vary",
651
Name
= "Cache-Control",
656
Name
= "Content-Encoding",
661
Name
= "Content-Length",
666
Name
= "Content-Type",
671
Name
= "ETag",
676
Name
= "Last-Modified",
681
Name
= "Vary",
698
Name
= "Cache-Control",
702
Name
= "Content-Encoding",
706
Name
= "Content-Length",
710
Name
= "Content-Type",
714
Name
= "ETag",
718
Name
= "Last-Modified",
722
Name
= "Vary",
809
new () {
Name
= "Content-Encoding", Value = "gzip" },
810
new () {
Name
= "Content-Type", Value = "text/javascript" },
811
new () {
Name
= "Vary", Value = "Accept-Encoding" }
822
new () {
Name
= "Content-Type", Value = "text/javascript" },
823
new () {
Name
= "Vary", Value = "Accept-Encoding" }
834
new () {
Name
= "Content-Encoding", Value = "gzip" },
835
new () {
Name
= "Content-Type", Value = "text/javascript" },
836
new () {
Name
= "Vary", Value = "Accept-Encoding" }
847
new () {
Name
= "Content-Type", Value = "text/javascript" },
848
new () {
Name
= "Vary", Value = "Accept-Encoding" }
859
new () {
Name
= "Content-Encoding", Value = "gzip" },
860
new () {
Name
= "Content-Type", Value = "text/javascript" },
861
new () {
Name
= "Vary", Value = "Accept-Encoding" }
914
new () {
Name
= "Content-Encoding", Value = "gzip" },
915
new (){
Name
= "Content-Type", Value = "text/javascript" },
916
new (){
Name
= "Vary", Value = "Accept-Encoding" }
927
new (){
Name
= "Content-Type", Value = "text/javascript" }
938
new (){
Name
= "Content-Encoding", Value = "gzip" },
939
new (){
Name
= "Content-Type", Value = "text/javascript" },
940
new (){
Name
= "Vary", Value = "Accept-Encoding" }
951
new () {
Name
= "Content-Type", Value = "text/javascript" }
962
new () {
Name
= "Content-Encoding", Value = "gzip" },
963
new () {
Name
= "Content-Type", Value = "text/javascript" },
964
new () {
Name
= "Vary", Value = "Accept-Encoding" }
985
new () {
Name
= "Content-Encoding", Value = "gzip" },
986
new () {
Name
= "Content-Type", Value = "text/javascript" },
987
new () {
Name
= "Vary", Value = "Accept-Encoding" }
998
new () {
Name
= "Content-Type", Value = "text/javascript" },
999
new () {
Name
= "Vary", Value = "Accept-Encoding" }
1010
new () {
Name
= "Content-Encoding", Value = "gzip" },
1011
new () {
Name
= "Content-Type", Value = "text/javascript" },
1012
new () {
Name
= "Vary", Value = "Accept-Encoding" }
1023
new () {
Name
= "Content-Type", Value = "text/javascript" },
1024
new () {
Name
= "Vary", Value = "Accept-Encoding" }
1035
new () {
Name
= "Content-Encoding", Value = "gzip" },
1036
new () {
Name
= "Content-Type", Value = "text/javascript" },
1037
new () {
Name
= "Vary", Value = "Accept-Encoding" }
1106
new () {
Name
= "Content-Encoding", Value = "gzip" },
1107
new (){
Name
= "Content-Type", Value = "text/javascript" },
1108
new (){
Name
= "Vary", Value = "Accept-Encoding" }
1119
new (){
Name
= "Content-Type", Value = "text/javascript" }
1130
new (){
Name
= "Content-Encoding", Value = "gzip" },
1131
new (){
Name
= "Content-Type", Value = "text/javascript" },
1132
new (){
Name
= "Vary", Value = "Accept-Encoding" }
1143
new () {
Name
= "Content-Type", Value = "text/javascript" }
1154
new () {
Name
= "Content-Encoding", Value = "gzip" },
1155
new () {
Name
= "Content-Type", Value = "text/javascript" },
1156
new () {
Name
= "Vary", Value = "Accept-Encoding" }
1167
new () {
Name
= "Content-Type", Value = "text/javascript" },
1188
new () {
Name
= "Content-Encoding", Value = "gzip" },
1189
new () {
Name
= "Content-Type", Value = "text/javascript" },
1190
new () {
Name
= "Vary", Value = "Accept-Encoding" }
1201
new () {
Name
= "Content-Encoding", Value = "br" },
1202
new () {
Name
= "Content-Type", Value = "text/javascript" },
1203
new () {
Name
= "Vary", Value = "Accept-Encoding" }
1214
new () {
Name
= "Content-Type", Value = "text/javascript" },
1215
new () {
Name
= "Vary", Value = "Accept-Encoding" }
1226
new () {
Name
= "Content-Encoding", Value = "gzip" },
1227
new () {
Name
= "Content-Type", Value = "text/javascript" },
1228
new () {
Name
= "Vary", Value = "Accept-Encoding" }
1239
new () {
Name
= "Content-Encoding", Value = "br" },
1240
new () {
Name
= "Content-Type", Value = "text/javascript" },
1241
new () {
Name
= "Vary", Value = "Accept-Encoding" }
1252
new () {
Name
= "Content-Type", Value = "text/javascript" },
1253
new () {
Name
= "Vary", Value = "Accept-Encoding" }
1264
new () {
Name
= "Content-Encoding", Value = "gzip" },
1265
new () {
Name
= "Content-Type", Value = "text/javascript" },
1266
new () {
Name
= "Vary", Value = "Accept-Encoding" }
1277
new () {
Name
= "Content-Encoding", Value = "br" },
1278
new () {
Name
= "Content-Type", Value = "text/javascript" },
1279
new () {
Name
= "Vary", Value = "Accept-Encoding" }
1372
new () {
Name
= "Content-Encoding", Value = "gzip" },
1373
new () {
Name
= "Content-Length", Value = "9" },
1374
new () {
Name
= "Content-Type", Value = "text/javascript" },
1375
new () {
Name
= "Vary", Value = "Accept-Encoding" }
1386
new () {
Name
= "Content-Length", Value = "20" },
1387
new () {
Name
= "Content-Type", Value = "text/javascript" },
1388
new () {
Name
= "Vary", Value = "Accept-Encoding" },
1399
new () {
Name
= "Content-Encoding", Value = "gzip" },
1400
new () {
Name
= "Content-Length", Value = "9" },
1401
new () {
Name
= "Content-Type", Value = "text/javascript" },
1402
new () {
Name
= "Vary", Value = "Accept-Encoding" }
1413
new () {
Name
= "Content-Length", Value = "18" },
1414
new () {
Name
= "Content-Type", Value = "text/javascript" },
1415
new () {
Name
= "Vary", Value = "Accept-Encoding" },
1428
Name
= "Content-Type",
1431
..(AdditionalHeaders ?? []).Select(h => new StaticWebAssetEndpointResponseHeader {
Name
= h.name, Value = h.value })
StaticWebAssets\DefineStaticWebAssetEndpointsTest.cs (34)
63
Name
= "Cache-Control",
68
Name
= "Content-Length",
73
Name
= "Content-Type",
78
Name
= "ETag",
83
Name
= "Last-Modified",
148
Name
= "Content-Length",
153
Name
= "Content-Type",
158
Name
= "ETag",
163
Name
= "Last-Modified",
168
Name
= "Cache-Control",
180
Name
= "Cache-Control",
185
Name
= "Content-Length",
190
Name
= "Content-Type",
195
Name
= "ETag",
200
Name
= "Last-Modified",
265
Name
= "Content-Length",
270
Name
= "Content-Type",
275
Name
= "ETag",
280
Name
= "Last-Modified",
285
Name
= "Cache-Control",
297
Name
= "Cache-Control",
302
Name
= "Content-Length",
307
Name
= "Content-Type",
312
Name
= "ETag",
317
Name
= "Last-Modified",
335
Name
= "Content-Length",
339
Name
= "Content-Type",
343
Name
= "ETag",
347
Name
= "Last-Modified",
559
Name
= "Content-Length",
564
Name
= "Content-Type",
569
Name
= "ETag",
574
Name
= "Last-Modified",
579
Name
= "Cache-Control",
StaticWebAssets\GenerateStaticWebAssetEndpointsManifestTest.cs (20)
28
Name
= "Cache-Control",
32
Name
= "Content-Length",
36
Name
= "Content-Type",
40
Name
= "ETag",
44
Name
= "Last-Modified",
71
Name
= "Cache-Control",
75
Name
= "Content-Length",
79
Name
= "Content-Type",
83
Name
= "ETag",
87
Name
= "Last-Modified",
114
Name
= "Cache-Control",
118
Name
= "Content-Length",
122
Name
= "Content-Type",
126
Name
= "ETag",
130
Name
= "Last-Modified",
147
Name
= "Cache-Control",
151
Name
= "Content-Length",
155
Name
= "Content-Type",
159
Name
= "ETag",
163
Name
= "Last-Modified",
StaticWebAssets\GenerateStaticWebAssetEndpointsPropsFileTest.cs (2)
61
Name
= "Content-Length",
131
Name
= "Content-Length",
StaticWebAssets\GenerateStaticWebAssetsManifestTest.cs (4)
122
Name
= "Content-Type",
127
Name
= "Content-Length",
132
Name
= "ETag",
137
Name
= "Last-Modified",
StaticWebAssets\UpdateStaticWebAssetEndpointsTest.cs (2)
119
endpoint.ResponseHeaders = [.. endpoint.ResponseHeaders, new StaticWebAssetEndpointResponseHeader {
Name
= "ETag", Value = "W/\"integrity\"" }];
164
endpoint.ResponseHeaders = [.. endpoint.ResponseHeaders, new StaticWebAssetEndpointResponseHeader {
Name
= "ETag", Value = "W/\"integrity\"" }];
61 references to Name
Microsoft.NET.Sdk.BlazorWebAssembly.Tests (5)
StaticWebAssetsBaselineComparer.cs (4)
141
Array.Sort(endpoint.ResponseHeaders, (a, b) => (a.
Name
, a.Value).CompareTo((b.
Name
, b.Value)));
467
assetDifferences.Add($"Expected manifest to have response header '{difference.
Name
}={difference.Value}' but it was not found.");
471
assetDifferences.Add($"Found unexpected response header '{difference.
Name
}={difference.Value}'.");
StaticWebAssetsBaselineFactory.cs (1)
121
switch (header.
Name
)
Microsoft.NET.Sdk.StaticWebAssets.Tasks (23)
ApplyCompressionNegotiation.cs (11)
168
if (string.Equals(header.
Name
, "Vary", StringComparison.OrdinalIgnoreCase) &&
184
result.Add(responseHeader.
Name
);
259
if (string.Equals(header.
Name
, "ETag", StringComparison.Ordinal))
297
if (string.Equals(responseHeader.
Name
, "Content-Encoding", StringComparison.Ordinal))
372
if (string.Equals(header.
Name
, "Content-Type", StringComparison.Ordinal))
380
Log.LogMessage(MessageImportance.Low, " Adding header '{0}' to related endpoint '{1}'", header.
Name
, relatedEndpointCandidateRoute);
392
if (!compressedHeaders.Contains(header.
Name
))
394
Log.LogMessage(MessageImportance.Low, " Adding header '{0}' to related endpoint '{1}'", header.
Name
, relatedEndpointCandidate.Route);
397
else if (string.Equals(AttachWeakETagToCompressedAssets, "ResponseHeader", StringComparison.Ordinal) && string.Equals(header.
Name
, "ETag", StringComparison.Ordinal))
412
}else if (string.Equals(header.
Name
, "Content-Type", StringComparison.Ordinal))
420
Log.LogMessage(MessageImportance.Low, " Skipping header '{0}' for related endpoint '{1}'", header.
Name
, relatedEndpointCandidate.Route);
Data\StaticWebAssetEndpoint.cs (2)
353
var responseHeaderComparison = ResponseHeaders[i].
Name
.CompareTo(other.ResponseHeaders[i].
Name
);
Data\StaticWebAssetEndpointResponseHeader.cs (6)
29
private string GetDebuggerDisplay() => $"{
Name
}: {Value}";
34
public bool Equals(StaticWebAssetEndpointResponseHeader other) => string.Equals(
Name
, other.
Name
, StringComparison.Ordinal) &&
45
return HashCode.Combine(
Name
, Value);
49
public int CompareTo(StaticWebAssetEndpointResponseHeader other) => string.CompareOrdinal(
Name
, other.
Name
) switch
FilterStaticWebAssetEndpoints.cs (1)
122
if (MeetsCriteria(criteria, header.
Name
, header.Value))
UpdateStaticWebAssetEndpoints.cs (3)
132
var (headers, headerRemoved) = RemoveAllIfFound(endpoint.ResponseHeaders, h => h.
Name
, h => h.Value, operation.Name, operation.Value);
222
h => h.
Name
,
290
var (headers, headerRemoved) = RemoveFirstIfFound(endpoint.ResponseHeaders, h => h.
Name
, h => h.Value, operation.Name, operation.Value);
Microsoft.NET.Sdk.StaticWebAssets.Tests (33)
StaticWebAssetEndpointsIntegrationTest.cs (5)
197
var contentLength = endpoint.ResponseHeaders.Single(rh => rh.
Name
== "Content-Length");
218
uncompressedAppJsEndpoint.Single().ResponseHeaders.Select(h => h.
Name
).Should().BeEquivalentTo(
229
var eTagHeader = uncompressedAppJsEndpoint.Single().ResponseHeaders.Single(h => h.
Name
== "ETag");
233
gzipCompressedAppJsEndpoint.Single().ResponseHeaders.Select(h => h.
Name
).Should().BeEquivalentTo(
247
brotliCompressedAppJsEndpoint.Single().ResponseHeaders.Select(h => h.
Name
).Should().BeEquivalentTo(
StaticWebAssets\ApplyCompressionNegotiationTest.cs (2)
1562
compressedEndpoint.ResponseHeaders.Should().Contain(h => h.
Name
== "ETag" && h.Value == "W/\"original-etag\"");
1696
compressedEndpoint.ResponseHeaders.Should().NotContain(h => h.
Name
== "ETag" && h.Value.StartsWith("W/"));
StaticWebAssets\DefineStaticWebAssetEndpointsTest.cs (2)
430
endpoint.ResponseHeaders.Should().ContainSingle(h => h.
Name
== "Content-Type" && h.Value == "application/x-gzip");
481
endpoint.ResponseHeaders.Should().ContainSingle(h => h.
Name
== "Content-Type" && h.Value == "text/css");
StaticWebAssets\FilterStaticWebAssetEndpointsTest.cs (2)
128
filteredEndpoints.Should().AllSatisfy(e => e.ResponseHeaders.Should().ContainSingle(p => p.
Name
== "Content-Type" && p.Value == "text/html"));
238
filteredEndpoints.Should().AllSatisfy(e => e.ResponseHeaders.Should().ContainSingle(p => p.
Name
== "Content-Type" && p.Value == "text/html"));
StaticWebAssets\UpdateStaticWebAssetEndpointsTest.cs (9)
33
endpoint.ResponseHeaders = endpoint.ResponseHeaders.Where(h => !string.Equals(h.
Name
, "Cache-Control", StringComparison.Ordinal)).ToArray();
56
updatedEndpoint.ResponseHeaders.Should().ContainSingle(h => string.Equals(h.
Name
, "Cache-Control", StringComparison.Ordinal) && string.Equals(h.Value, "immutable"));
97
updatedEndpoint.ResponseHeaders.Should().NotContain(h => string.Equals(h.
Name
, "Cache-Control", StringComparison.Ordinal));
142
updatedEndpoint.ResponseHeaders.Should().NotContain(h => string.Equals(h.
Name
, "ETag", StringComparison.Ordinal));
187
updatedEndpoint.ResponseHeaders.Should().ContainSingle(h => string.Equals(h.
Name
, "ETag", StringComparison.Ordinal) && string.Equals(h.Value, "\"integrity\"", StringComparison.Ordinal));
188
updatedEndpoint.ResponseHeaders.Should().NotContain(h => string.Equals(h.
Name
, "ETag", StringComparison.Ordinal) && string.Equals(h.Value, "W/\"integrity\"", StringComparison.Ordinal));
229
updatedEndpoint.ResponseHeaders.Should().ContainSingle(h => string.Equals(h.
Name
, "Cache-Control", StringComparison.Ordinal) && string.Equals(h.Value, "immutable"));
263
endpoint.ResponseHeaders = endpoint.ResponseHeaders.Where(h => !string.Equals(h.
Name
, "Cache-Control", StringComparison.Ordinal)).ToArray();
291
updatedEndpoint.ResponseHeaders.Should().ContainSingle(h => string.Equals(h.
Name
, "Cache-Control", StringComparison.Ordinal) && string.Equals(h.Value, "immutable"));
StaticWebAssetsBaselineComparer.cs (4)
141
Array.Sort(endpoint.ResponseHeaders, (a, b) => (a.
Name
, a.Value).CompareTo((b.
Name
, b.Value)));
467
assetDifferences.Add($"Expected manifest to have response header '{difference.
Name
}={difference.Value}' but it was not found.");
471
assetDifferences.Add($"Found unexpected response header '{difference.
Name
}={difference.Value}'.");
StaticWebAssetsBaselineFactory.cs (1)
121
switch (header.
Name
)
StaticWebAssetsCompressionIntegrationTest.cs (8)
74
endpoint.ResponseHeaders.Where(e => e.
Name
== "Content-Encoding").Select(e => e.Value).Single().Should().Be("gzip");
76
var etags = endpoint.ResponseHeaders.Where(e => e.
Name
== "ETag").Select(e => EntityTagHeaderValue.Parse(e.Value));
86
endpoint.ResponseHeaders.Where(e => e.
Name
== "Content-Encoding").Select(e => e.Value).Single().Should().Be("br");
88
var etags = endpoint.ResponseHeaders.Where(e => e.
Name
== "ETag").Select(e => EntityTagHeaderValue.Parse(e.Value));
186
endpoint.ResponseHeaders.Where(e => e.
Name
== "Content-Encoding").Select(e => e.Value).Single().Should().Be("gzip");
188
var etags = endpoint.ResponseHeaders.Where(e => e.
Name
== "ETag").Select(e => EntityTagHeaderValue.Parse(e.Value));
198
endpoint.ResponseHeaders.Where(e => e.
Name
== "Content-Encoding").Select(e => e.Value).Single().Should().Be("br");
200
var etags = endpoint.ResponseHeaders.Where(e => e.
Name
== "ETag").Select(e => EntityTagHeaderValue.Parse(e.Value));