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