105 instantiations of HeaderDescriptor
System.Net.Http (105)
System\Net\Http\Headers\HeaderDescriptor.cs (5)
66descriptor = new HeaderDescriptor(knownHeader); 76descriptor = new HeaderDescriptor(headerName); 88descriptor = new HeaderDescriptor(knownHeader); 98descriptor = new HeaderDescriptor(HttpRuleParser.GetTokenString(headerName)); 129return new HeaderDescriptor(Name, customHeader: true);
System\Net\Http\Headers\KnownHeader.cs (1)
49public HeaderDescriptor Descriptor => new HeaderDescriptor(this);
System\Net\Http\Headers\QPackStaticTable.cs (99)
12(new HeaderDescriptor(":authority"), ""), // 0 13(new HeaderDescriptor(":path"), "/"), // 1 14(new HeaderDescriptor(KnownHeaders.Age), "0"), // 2 15(new HeaderDescriptor(KnownHeaders.ContentDisposition), ""), // 3 16(new HeaderDescriptor(KnownHeaders.ContentLength), "0"), // 4 17(new HeaderDescriptor(KnownHeaders.Cookie), ""), // 5 18(new HeaderDescriptor(KnownHeaders.Date), ""), // 6 19(new HeaderDescriptor(KnownHeaders.ETag), ""), // 7 20(new HeaderDescriptor(KnownHeaders.IfModifiedSince), ""), // 8 21(new HeaderDescriptor(KnownHeaders.IfNoneMatch), ""), // 9 22(new HeaderDescriptor(KnownHeaders.LastModified), ""), // 10 23(new HeaderDescriptor(KnownHeaders.Link), ""), // 11 24(new HeaderDescriptor(KnownHeaders.Location), ""), // 12 25(new HeaderDescriptor(KnownHeaders.Referer), ""), // 13 26(new HeaderDescriptor(KnownHeaders.SetCookie), ""), // 14 27(new HeaderDescriptor(":method"), "CONNECT"), // 15 28(new HeaderDescriptor(":method"), "DELETE"), // 16 29(new HeaderDescriptor(":method"), "GET"), // 17 30(new HeaderDescriptor(":method"), "HEAD"), // 18 31(new HeaderDescriptor(":method"), "OPTIONS"), // 19 32(new HeaderDescriptor(":method"), "POST"), // 20 33(new HeaderDescriptor(":method"), "PUT"), // 21 34(new HeaderDescriptor(":scheme"), "http"), // 22 35(new HeaderDescriptor(":scheme"), "https"), // 23 36(new HeaderDescriptor(KnownHeaders.PseudoStatus), "103"), // 24 37(new HeaderDescriptor(KnownHeaders.PseudoStatus), "200"), // 25 38(new HeaderDescriptor(KnownHeaders.PseudoStatus), "304"), // 26 39(new HeaderDescriptor(KnownHeaders.PseudoStatus), "404"), // 27 40(new HeaderDescriptor(KnownHeaders.PseudoStatus), "503"), // 28 41(new HeaderDescriptor(KnownHeaders.Accept), "*/*"), // 29 42(new HeaderDescriptor(KnownHeaders.Accept), "application/dns-message"), // 30 43(new HeaderDescriptor(KnownHeaders.AcceptEncoding), "gzip, deflate, br"), // 31 44(new HeaderDescriptor(KnownHeaders.AcceptRanges), "bytes"), // 32 45(new HeaderDescriptor(KnownHeaders.AccessControlAllowHeaders), "cache-control"), // 33 46(new HeaderDescriptor(KnownHeaders.AccessControlAllowHeaders), "content-type"), // 34 47(new HeaderDescriptor(KnownHeaders.AccessControlAllowOrigin), "*"), // 35 48(new HeaderDescriptor(KnownHeaders.CacheControl), "max-age=0"), // 36 49(new HeaderDescriptor(KnownHeaders.CacheControl), "max-age=2592000"), // 37 50(new HeaderDescriptor(KnownHeaders.CacheControl), "max-age=604800"), // 38 51(new HeaderDescriptor(KnownHeaders.CacheControl), "no-cache"), // 39 52(new HeaderDescriptor(KnownHeaders.CacheControl), "no-store"), // 40 53(new HeaderDescriptor(KnownHeaders.CacheControl), "public, max-age=31536000"), // 41 54(new HeaderDescriptor(KnownHeaders.ContentEncoding), "br"), // 42 55(new HeaderDescriptor(KnownHeaders.ContentEncoding), "gzip"), // 43 56(new HeaderDescriptor(KnownHeaders.ContentType), "application/dns-message"), // 44 57(new HeaderDescriptor(KnownHeaders.ContentType), "application/javascript"), // 45 58(new HeaderDescriptor(KnownHeaders.ContentType), "application/json"), // 46 59(new HeaderDescriptor(KnownHeaders.ContentType), "application/x-www-form-urlencoded"), // 47 60(new HeaderDescriptor(KnownHeaders.ContentType), "image/gif"), // 48 61(new HeaderDescriptor(KnownHeaders.ContentType), "image/jpeg"), // 49 62(new HeaderDescriptor(KnownHeaders.ContentType), "image/png"), // 50 63(new HeaderDescriptor(KnownHeaders.ContentType), "text/css"), // 51 64(new HeaderDescriptor(KnownHeaders.ContentType), "text/html; charset=utf-8"), // 52; Whitespace is correct, see spec. 65(new HeaderDescriptor(KnownHeaders.ContentType), "text/plain"), // 53 66(new HeaderDescriptor(KnownHeaders.ContentType), "text/plain;charset=utf-8"), // 54; Whitespace is correct, see spec. 67(new HeaderDescriptor(KnownHeaders.Range), "bytes=0-"), // 55 68(new HeaderDescriptor(KnownHeaders.StrictTransportSecurity), "max-age=31536000"), // 56 69(new HeaderDescriptor(KnownHeaders.StrictTransportSecurity), "max-age=31536000; includesubdomains"), // 57 70(new HeaderDescriptor(KnownHeaders.StrictTransportSecurity), "max-age=31536000; includesubdomains; preload"), // 58 71(new HeaderDescriptor(KnownHeaders.Vary), "accept-encoding"), // 59 72(new HeaderDescriptor(KnownHeaders.Vary), "origin"), // 60 73(new HeaderDescriptor(KnownHeaders.XContentTypeOptions), "nosniff"), // 61 74(new HeaderDescriptor(KnownHeaders.XXssProtection), "1; mode=block"), // 62 75(new HeaderDescriptor(KnownHeaders.PseudoStatus), "100"), // 63 76(new HeaderDescriptor(KnownHeaders.PseudoStatus), "204"), // 64 77(new HeaderDescriptor(KnownHeaders.PseudoStatus), "206"), // 65 78(new HeaderDescriptor(KnownHeaders.PseudoStatus), "302"), // 66 79(new HeaderDescriptor(KnownHeaders.PseudoStatus), "400"), // 67 80(new HeaderDescriptor(KnownHeaders.PseudoStatus), "403"), // 68 81(new HeaderDescriptor(KnownHeaders.PseudoStatus), "421"), // 69 82(new HeaderDescriptor(KnownHeaders.PseudoStatus), "425"), // 70 83(new HeaderDescriptor(KnownHeaders.PseudoStatus), "500"), // 71 84(new HeaderDescriptor(KnownHeaders.AcceptLanguage), ""), // 72 85(new HeaderDescriptor(KnownHeaders.AccessControlAllowCredentials), "FALSE"), // 73 86(new HeaderDescriptor(KnownHeaders.AccessControlAllowCredentials), "TRUE"), // 74 87(new HeaderDescriptor(KnownHeaders.AccessControlAllowHeaders), "*"), // 75 88(new HeaderDescriptor(KnownHeaders.AccessControlAllowMethods), "get"), // 76 89(new HeaderDescriptor(KnownHeaders.AccessControlAllowMethods), "get, post, options"), // 77 90(new HeaderDescriptor(KnownHeaders.AccessControlAllowMethods), "options"), // 78 91(new HeaderDescriptor(KnownHeaders.AccessControlExposeHeaders), "content-length"), // 79 92(new HeaderDescriptor("access-control-request-headers"), "content-type"), // 80 93(new HeaderDescriptor("access-control-request-method"), "get"), // 81 94(new HeaderDescriptor("access-control-request-method"), "post"), // 82 95(new HeaderDescriptor(KnownHeaders.AltSvc), "clear"), // 83 96(new HeaderDescriptor(KnownHeaders.Authorization), ""), // 84 97(new HeaderDescriptor(KnownHeaders.ContentSecurityPolicy), "script-src 'none'; object-src 'none'; base-uri 'none'"), // 85 98(new HeaderDescriptor("early-data"), "1"), // 86 99(new HeaderDescriptor(KnownHeaders.ExpectCT), ""), // 87 100(new HeaderDescriptor("forwarded"), ""), // 88 101(new HeaderDescriptor(KnownHeaders.IfRange), ""), // 89 102(new HeaderDescriptor(KnownHeaders.Origin), ""), // 90 103(new HeaderDescriptor("purpose"), "prefetch"), // 91 104(new HeaderDescriptor(KnownHeaders.Server), ""), // 92 105(new HeaderDescriptor("timing-allow-origin"), "*"), // 93 106(new HeaderDescriptor(KnownHeaders.UpgradeInsecureRequests), "1"), // 94 107(new HeaderDescriptor(KnownHeaders.UserAgent), ""), // 95 108(new HeaderDescriptor("x-forwarded-for"), ""), // 96 109(new HeaderDescriptor(KnownHeaders.XFrameOptions), "deny"), // 97 110(new HeaderDescriptor(KnownHeaders.XFrameOptions), "sameorigin") // 98
107 references to HeaderDescriptor
System.Net.Http (107)
System\Net\Http\DiagnosticsHandler.cs (8)
23private readonly HeaderDescriptor[]? _propagatorFields; 36var fieldDescriptors = new List<HeaderDescriptor>(fields.Count); 39if (field is not null && HeaderDescriptor.TryGet(field, out HeaderDescriptor descriptor)) 100if (request.WasRedirected() && _propagatorFields is HeaderDescriptor[] fields) 102foreach (HeaderDescriptor field in fields) 352HeaderDescriptor.TryGet(key, out HeaderDescriptor descriptor) &&
System\Net\Http\Headers\HeaderDescriptor.cs (9)
16internal readonly struct HeaderDescriptor : IEquatable<HeaderDescriptor> 42public bool Equals(HeaderDescriptor other) 59public static bool TryGet(string headerName, out HeaderDescriptor descriptor) 72descriptor = default(HeaderDescriptor); 81public static bool TryGet(ReadOnlySpan<byte> headerName, out HeaderDescriptor descriptor) 94descriptor = default(HeaderDescriptor); 102internal static bool TryGetStaticQPackHeader(int index, out HeaderDescriptor descriptor, [NotNullWhen(true)] out string? knownValue) 107(HeaderDescriptor descriptor, string value)[] qpackStaticTable = QPackStaticTable.HeaderLookup; 125public HeaderDescriptor AsCustomHeader()
System\Net\Http\Headers\HeaderStringValues.cs (3)
13private readonly HeaderDescriptor _header; 20internal HeaderStringValues(HeaderDescriptor descriptor, string value) 29internal HeaderStringValues(HeaderDescriptor descriptor, string[] values)
System\Net\Http\Headers\HeaderUtilities.cs (2)
273internal static DateTimeOffset? GetDateTimeOffsetValue(HeaderDescriptor descriptor, HttpHeaders store, DateTimeOffset? defaultValue = null) 290internal static TimeSpan? GetTimeSpanValue(HeaderDescriptor descriptor, HttpHeaders store)
System\Net\Http\Headers\HttpHeaders.cs (54)
21public HeaderDescriptor Key; 24public HeaderEntry(HeaderDescriptor key, object value) 53/// <summary>Either a <see cref="HeaderEntry"/> array or a Dictionary&lt;<see cref="HeaderDescriptor"/>, <see cref="object"/>&gt; </summary> 79internal void Add(HeaderDescriptor descriptor, string? value) 99internal void Add(HeaderDescriptor descriptor, IEnumerable<string?> values) 131TryGetHeaderDescriptor(name, out HeaderDescriptor descriptor) && 134internal bool TryAddWithoutValidation(HeaderDescriptor descriptor, string? value) 165TryGetHeaderDescriptor(name, out HeaderDescriptor descriptor) && 168internal bool TryAddWithoutValidation(HeaderDescriptor descriptor, IEnumerable<string?> values) 232internal IEnumerable<string> GetValues(HeaderDescriptor descriptor) 244if (TryGetHeaderDescriptor(name, out HeaderDescriptor descriptor)) 253internal bool TryGetValues(HeaderDescriptor descriptor, [NotNullWhen(true)] out IEnumerable<string>? values) 309internal string GetHeaderString(HeaderDescriptor descriptor) 354: ref CollectionsMarshal.GetValueRefOrNullRef((Dictionary<HeaderDescriptor, object>)_headerStore, entry.Key); 378internal void AddParsedValue(HeaderDescriptor descriptor, object value) 392internal void SetParsedValue(HeaderDescriptor descriptor, object value) 407internal void SetOrRemoveParsedValue(HeaderDescriptor descriptor, object? value) 421internal bool RemoveParsedValue(HeaderDescriptor descriptor, object value) 499internal bool ContainsParsedValue(HeaderDescriptor descriptor, object value) 605private static HeaderStoreItemInfo CloneHeaderInfo(HeaderDescriptor descriptor, HeaderStoreItemInfo sourceInfo) 681private HeaderStoreItemInfo GetOrCreateHeaderInfo(HeaderDescriptor descriptor) 693private HeaderStoreItemInfo CreateAndAddHeaderToStore(HeaderDescriptor descriptor) 708internal bool TryGetHeaderValue(HeaderDescriptor descriptor, [NotNullWhen(true)] out object? value) 723private bool TryGetAndParseHeaderInfo(HeaderDescriptor key, [NotNullWhen(true)] out HeaderStoreItemInfo? info) 767private static void ParseRawHeaderValues(HeaderDescriptor descriptor, HeaderStoreItemInfo info) 797private static void ParseSingleRawHeaderValue(HeaderStoreItemInfo info, HeaderDescriptor descriptor, string rawValue) 822internal bool TryParseAndAddValue(HeaderDescriptor descriptor, string? value) 846private static bool TryParseAndAddRawHeaderValue(HeaderDescriptor descriptor, HeaderStoreItemInfo info, string? value, bool addWhenInvalid) 976internal object? GetSingleParsedValue(HeaderDescriptor descriptor) 986internal object? GetParsedAndInvalidValues(HeaderDescriptor descriptor) 996internal virtual bool IsAllowedHeaderName(HeaderDescriptor descriptor) => true; 998private void PrepareHeaderInfoForAdd(HeaderDescriptor descriptor, out HeaderStoreItemInfo info, out bool addToStore) 1013private static void ParseAndAddValue(HeaderDescriptor descriptor, HeaderStoreItemInfo info, string? value) 1075private HeaderDescriptor GetHeaderDescriptor(string name) 1079if (!HeaderDescriptor.TryGet(name, out HeaderDescriptor descriptor)) 1096internal bool TryGetHeaderDescriptor(string name, out HeaderDescriptor descriptor) 1104if (HeaderDescriptor.TryGet(name, out descriptor)) 1136internal static string[] GetStoreValuesAsStringArray(HeaderDescriptor descriptor, HeaderStoreItemInfo info) 1143internal static void GetStoreValuesAsStringOrStringArray(HeaderDescriptor descriptor, object sourceValues, out string? singleValue, out string[]? multiValue) 1179internal static int GetStoreValuesIntoStringArray(HeaderDescriptor descriptor, object sourceValues, [NotNull] ref string[]? values) 1389var dictionary = (Dictionary<HeaderDescriptor, object>)_headerStore!; 1392foreach (KeyValuePair<HeaderDescriptor, object> entry in dictionary) 1413private ref object GetValueRefOrNullRef(HeaderDescriptor key) 1431valueRef = ref CollectionsMarshal.GetValueRefOrNullRef(Unsafe.As<Dictionary<HeaderDescriptor, object>>(store), key); 1437private ref object? GetValueRefOrAddDefault(HeaderDescriptor key) 1474ref object? GrowEntriesAndAddDefault(HeaderDescriptor key) 1491ref object? ConvertToDictionaryAndAddDefault(HeaderDescriptor key) 1494var dictionary = new Dictionary<HeaderDescriptor, object>(ArrayThreshold); 1504ref object? DictionaryGetValueRefOrAddDefault(HeaderDescriptor key) 1506var dictionary = (Dictionary<HeaderDescriptor, object>)_headerStore!; 1534internal bool Contains(HeaderDescriptor key) 1552internal bool Remove(HeaderDescriptor key) 1576removed = Unsafe.As<Dictionary<HeaderDescriptor, object>>(store).Remove(key);
System\Net\Http\Headers\HttpHeadersNonValidated.cs (2)
35headers.TryGetHeaderDescriptor(headerName, out HeaderDescriptor descriptor) && 65headers.TryGetHeaderDescriptor(headerName, out HeaderDescriptor descriptor) &&
System\Net\Http\Headers\HttpHeaderValueCollection.cs (2)
35private readonly HeaderDescriptor _descriptor; 48internal HttpHeaderValueCollection(HeaderDescriptor descriptor, HttpHeaders store)
System\Net\Http\Headers\HttpResponseHeaders.cs (1)
158internal override bool IsAllowedHeaderName(HeaderDescriptor descriptor)
System\Net\Http\Headers\KnownHeader.cs (1)
49public HeaderDescriptor Descriptor => new HeaderDescriptor(this);
System\Net\Http\Headers\QPackStaticTable.cs (2)
10internal static (HeaderDescriptor descriptor, string value)[] HeaderLookup { get; } = new (HeaderDescriptor descriptor, string value)[]
System\Net\Http\SocketsHttpHandler\Http2Stream.cs (7)
502private static readonly (HeaderDescriptor descriptor, byte[] value)[] s_hpackStaticHeaderTable = new (HeaderDescriptor, byte[])[LastHPackNormalHeaderId - FirstHPackNormalHeaderId + 1] 570(HeaderDescriptor descriptor, byte[] value) = s_hpackStaticHeaderTable[index - FirstHPackNormalHeaderId]; 593(HeaderDescriptor descriptor, _) = s_hpackStaticHeaderTable[index - FirstHPackNormalHeaderId]; 677private void OnHeader(HeaderDescriptor descriptor, ReadOnlySpan<byte> value) 751if (!HeaderDescriptor.TryGet(name, out HeaderDescriptor descriptor))
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (11)
47private List<(HeaderDescriptor name, string value)>? _trailingHeaders; 556_trailingHeaders = new List<(HeaderDescriptor name, string value)>(); 594foreach ((HeaderDescriptor name, string value) in _trailingHeaders) 946if (!HeaderDescriptor.TryGet(name, out HeaderDescriptor descriptor)) 956GetStaticQPackHeader(index, out HeaderDescriptor descriptor, out string? knownValue); 962GetStaticQPackHeader(index, out HeaderDescriptor descriptor, knownValue: out _); 971private void GetStaticQPackHeader(int index, out HeaderDescriptor descriptor, out string? knownValue) 973if (!HeaderDescriptor.TryGetStaticQPackHeader(index, out descriptor, out knownValue)) 985private void OnHeader(int? staticIndex, HeaderDescriptor descriptor, string? staticValue, ReadOnlySpan<byte> literalValue) 1357_trailingHeaders = new List<(HeaderDescriptor name, string value)>();
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (2)
1271if (!HeaderDescriptor.TryGet(name, out HeaderDescriptor descriptor))
System\Net\Http\SocketsHttpHandler\HttpConnectionBase.cs (3)
125/// <summary>Uses <see cref="HeaderDescriptor.GetHeaderValue"/>, but first special-cases several known headers for which we can use caching.</summary> 126public string GetResponseHeaderValueWithCaching(HeaderDescriptor descriptor, ReadOnlySpan<byte> value, Encoding? valueEncoding) 133static string GetOrAddCachedValue([NotNull] ref string? cache, HeaderDescriptor descriptor, ReadOnlySpan<byte> value, Encoding? encoding)