134 references to HttpHeaderType
System.Net.Http (134)
System\Net\Http\Headers\HeaderDescriptor.cs (3)
39
public
HttpHeaderType
HeaderType => _descriptor is KnownHeader knownHeader ? knownHeader.HeaderType :
HttpHeaderType
.Custom;
130
Debug.Assert(HeaderType !=
HttpHeaderType
.Custom);
System\Net\Http\Headers\HttpContentHeaders.cs (3)
110
: base(
HttpHeaderType
.Content |
HttpHeaderType
.Custom,
HttpHeaderType
.None)
System\Net\Http\Headers\HttpHeaders.cs (9)
57
private readonly
HttpHeaderType
_allowedHeaderTypes;
58
private readonly
HttpHeaderType
_treatAsCustomHeaderTypes;
61
: this(
HttpHeaderType
.All,
HttpHeaderType
.None)
65
internal HttpHeaders(
HttpHeaderType
allowedHeaderTypes,
HttpHeaderType
treatAsCustomHeaderTypes)
70
_allowedHeaderTypes = allowedHeaderTypes & ~
HttpHeaderType
.NonTrailing;
71
_treatAsCustomHeaderTypes = treatAsCustomHeaderTypes & ~
HttpHeaderType
.NonTrailing;
1165
HttpHeaderType
headerType = descriptor.HeaderType;
System\Net\Http\Headers\HttpRequestHeaders.cs (4)
269
: base(
HttpHeaderType
.General |
HttpHeaderType
.Request |
HttpHeaderType
.Custom,
HttpHeaderType
.Response)
System\Net\Http\Headers\HttpResponseHeaders.cs (7)
137
: base(containsTrailingHeaders ?
HttpHeaderType
.All ^
HttpHeaderType
.Request :
HttpHeaderType
.General |
HttpHeaderType
.Response |
HttpHeaderType
.Custom,
138
HttpHeaderType
.Request)
167
return (knownHeader.HeaderType &
HttpHeaderType
.NonTrailing) == 0;
System\Net\Http\Headers\KnownHeader.cs (3)
12
: this(name,
HttpHeaderType
.Custom, parser: null, knownValues, http2StaticTableIndex, http3StaticTableIndex)
15
public KnownHeader(string name,
HttpHeaderType
headerType, HttpHeaderParser? parser, string[]? knownValues = null, int? http2StaticTableIndex = null, int? http3StaticTableIndex = null)
39
public
HttpHeaderType
HeaderType { get; }
System\Net\Http\Headers\KnownHeaders.cs (92)
16
public static readonly KnownHeader PseudoStatus = new(":status",
HttpHeaderType
.Response, parser: null);
17
public static readonly KnownHeader Accept = new("Accept",
HttpHeaderType
.Request, MediaTypeHeaderParser.MultipleValuesParser, null, H2StaticTable.Accept, H3StaticTable.AcceptAny);
18
public static readonly KnownHeader AcceptCharset = new("Accept-Charset",
HttpHeaderType
.Request, GenericHeaderParser.MultipleValueStringWithQualityParser, null, H2StaticTable.AcceptCharset);
19
public static readonly KnownHeader AcceptEncoding = new("Accept-Encoding",
HttpHeaderType
.Request, GenericHeaderParser.MultipleValueStringWithQualityParser, null, H2StaticTable.AcceptEncoding, H3StaticTable.AcceptEncodingGzipDeflateBr);
20
public static readonly KnownHeader AcceptLanguage = new("Accept-Language",
HttpHeaderType
.Request, GenericHeaderParser.MultipleValueStringWithQualityParser, null, H2StaticTable.AcceptLanguage, H3StaticTable.AcceptLanguage);
22
public static readonly KnownHeader AcceptRanges = new("Accept-Ranges",
HttpHeaderType
.Response, GenericHeaderParser.TokenListParser, ["bytes", "none"], H2StaticTable.AcceptRanges, H3StaticTable.AcceptRangesBytes);
23
public static readonly KnownHeader AccessControlAllowCredentials = new("Access-Control-Allow-Credentials",
HttpHeaderType
.Response, parser: null, ["true"], http3StaticTableIndex: H3StaticTable.AccessControlAllowCredentials);
24
public static readonly KnownHeader AccessControlAllowHeaders = new("Access-Control-Allow-Headers",
HttpHeaderType
.Response, parser: null, ["*"], http3StaticTableIndex: H3StaticTable.AccessControlAllowHeadersCacheControl);
25
public static readonly KnownHeader AccessControlAllowMethods = new("Access-Control-Allow-Methods",
HttpHeaderType
.Response, parser: null, ["POST", "*"], http3StaticTableIndex: H3StaticTable.AccessControlAllowMethodsGet);
26
public static readonly KnownHeader AccessControlAllowOrigin = new("Access-Control-Allow-Origin",
HttpHeaderType
.Response, parser: null, ["*", "null"], H2StaticTable.AccessControlAllowOrigin, H3StaticTable.AccessControlAllowOriginAny);
27
public static readonly KnownHeader AccessControlExposeHeaders = new("Access-Control-Expose-Headers",
HttpHeaderType
.Response, parser: null, ["*"], H3StaticTable.AccessControlExposeHeadersContentLength);
29
public static readonly KnownHeader Age = new("Age",
HttpHeaderType
.Response |
HttpHeaderType
.NonTrailing, TimeSpanHeaderParser.Parser, ["0"], H2StaticTable.Age, H3StaticTable.Age0);
30
public static readonly KnownHeader Allow = new("Allow",
HttpHeaderType
.Content, GenericHeaderParser.TokenListParser, null, H2StaticTable.Allow);
31
public static readonly KnownHeader AltSvc = new("Alt-Svc",
HttpHeaderType
.Response, GetAltSvcHeaderParser(), ["h3=\":443\"", "h3=\":443\"; ma=2592000", "clear"], http3StaticTableIndex: H3StaticTable.AltSvcClear);
32
public static readonly KnownHeader AltUsed = new("Alt-Used",
HttpHeaderType
.Request, parser: null);
33
public static readonly KnownHeader Authorization = new("Authorization",
HttpHeaderType
.Request |
HttpHeaderType
.NonTrailing, GenericHeaderParser.SingleValueAuthenticationParser, null, H2StaticTable.Authorization, H3StaticTable.Authorization);
34
public static readonly KnownHeader CacheControl = new("Cache-Control",
HttpHeaderType
.General |
HttpHeaderType
.NonTrailing, CacheControlHeaderParser.Parser, ["must-revalidate", "no-cache", "no-store", "no-transform", "private", "proxy-revalidate", "public"], H2StaticTable.CacheControl, H3StaticTable.CacheControlMaxAge0);
35
public static readonly KnownHeader Connection = new("Connection",
HttpHeaderType
.General, GenericHeaderParser.TokenListParser, ["keep-alive", "close", "Upgrade", "Transfer-Encoding"]);
36
public static readonly KnownHeader ContentDisposition = new("Content-Disposition",
HttpHeaderType
.Content |
HttpHeaderType
.NonTrailing, GenericHeaderParser.ContentDispositionParser, ["inline", "attachment"], H2StaticTable.ContentDisposition, H3StaticTable.ContentDisposition);
37
public static readonly KnownHeader ContentEncoding = new("Content-Encoding",
HttpHeaderType
.Content |
HttpHeaderType
.NonTrailing, GenericHeaderParser.TokenListParser, ["gzip", "deflate", "br", "zstd", "compress", "identity"], H2StaticTable.ContentEncoding, H3StaticTable.ContentEncodingBr);
38
public static readonly KnownHeader ContentLanguage = new("Content-Language",
HttpHeaderType
.Content, GenericHeaderParser.TokenListParser, null, H2StaticTable.ContentLanguage);
39
public static readonly KnownHeader ContentLength = new("Content-Length",
HttpHeaderType
.Content |
HttpHeaderType
.NonTrailing, Int64NumberHeaderParser.Parser, null, H2StaticTable.ContentLength, H3StaticTable.ContentLength0);
40
public static readonly KnownHeader ContentLocation = new("Content-Location",
HttpHeaderType
.Content |
HttpHeaderType
.NonTrailing, UriHeaderParser.RelativeOrAbsoluteUriParser, null, H2StaticTable.ContentLocation);
41
public static readonly KnownHeader ContentMD5 = new("Content-MD5",
HttpHeaderType
.Content, ByteArrayHeaderParser.Parser);
42
public static readonly KnownHeader ContentRange = new("Content-Range",
HttpHeaderType
.Content |
HttpHeaderType
.NonTrailing, GenericHeaderParser.ContentRangeParser, null, H2StaticTable.ContentRange);
44
public static readonly KnownHeader ContentType = new("Content-Type",
HttpHeaderType
.Content |
HttpHeaderType
.NonTrailing, MediaTypeHeaderParser.SingleValueParser, null, H2StaticTable.ContentType, H3StaticTable.ContentTypeApplicationDnsMessage);
45
public static readonly KnownHeader Cookie = new("Cookie",
HttpHeaderType
.Custom, CookieHeaderParser.Parser, null, H2StaticTable.Cookie, H3StaticTable.Cookie);
48
public static readonly KnownHeader Date = new("Date",
HttpHeaderType
.General |
HttpHeaderType
.NonTrailing, DateHeaderParser.Parser, null, H2StaticTable.Date, H3StaticTable.Date);
49
public static readonly KnownHeader ETag = new("ETag",
HttpHeaderType
.Response, GenericHeaderParser.SingleValueEntityTagParser, null, H2StaticTable.ETag, H3StaticTable.ETag);
50
public static readonly KnownHeader Expect = new("Expect",
HttpHeaderType
.Request |
HttpHeaderType
.NonTrailing, GenericHeaderParser.MultipleValueNameValueWithParametersParser, ["100-continue"], H2StaticTable.Expect);
52
public static readonly KnownHeader Expires = new("Expires",
HttpHeaderType
.Content |
HttpHeaderType
.NonTrailing, DateHeaderParser.Parser, ["Thu, 01 Jan 1970 00:00:01 GMT", "Mon, 01 Jan 1990 00:00:00 GMT"], H2StaticTable.Expires);
53
public static readonly KnownHeader From = new("From",
HttpHeaderType
.Request, GenericHeaderParser.SingleValueParserWithoutValidation, null, H2StaticTable.From);
57
public static readonly KnownHeader Host = new("Host",
HttpHeaderType
.Request |
HttpHeaderType
.NonTrailing, GenericHeaderParser.HostParser, null, H2StaticTable.Host);
58
public static readonly KnownHeader IfMatch = new("If-Match",
HttpHeaderType
.Request |
HttpHeaderType
.NonTrailing, GenericHeaderParser.MultipleValueEntityTagParser, null, H2StaticTable.IfMatch);
59
public static readonly KnownHeader IfModifiedSince = new("If-Modified-Since",
HttpHeaderType
.Request |
HttpHeaderType
.NonTrailing, DateHeaderParser.Parser, null, H2StaticTable.IfModifiedSince, H3StaticTable.IfModifiedSince);
60
public static readonly KnownHeader IfNoneMatch = new("If-None-Match",
HttpHeaderType
.Request |
HttpHeaderType
.NonTrailing, GenericHeaderParser.MultipleValueEntityTagParser, null, H2StaticTable.IfNoneMatch, H3StaticTable.IfNoneMatch);
61
public static readonly KnownHeader IfRange = new("If-Range",
HttpHeaderType
.Request |
HttpHeaderType
.NonTrailing, GenericHeaderParser.RangeConditionParser, null, H2StaticTable.IfRange, H3StaticTable.IfRange);
62
public static readonly KnownHeader IfUnmodifiedSince = new("If-Unmodified-Since",
HttpHeaderType
.Request |
HttpHeaderType
.NonTrailing, DateHeaderParser.Parser, null, H2StaticTable.IfUnmodifiedSince);
64
public static readonly KnownHeader LastModified = new("Last-Modified",
HttpHeaderType
.Content, DateHeaderParser.Parser, null, H2StaticTable.LastModified, H3StaticTable.LastModified);
66
public static readonly KnownHeader Location = new("Location",
HttpHeaderType
.Response |
HttpHeaderType
.NonTrailing, UriHeaderParser.RelativeOrAbsoluteUriParser, null, H2StaticTable.Location, H3StaticTable.Location);
67
public static readonly KnownHeader MaxForwards = new("Max-Forwards",
HttpHeaderType
.Request |
HttpHeaderType
.NonTrailing, Int32NumberHeaderParser.Parser, null, H2StaticTable.MaxForwards);
70
public static readonly KnownHeader Pragma = new("Pragma",
HttpHeaderType
.General |
HttpHeaderType
.NonTrailing, GenericHeaderParser.MultipleValueNameValueParser, ["no-cache"]);
71
public static readonly KnownHeader ProxyAuthenticate = new("Proxy-Authenticate",
HttpHeaderType
.Response |
HttpHeaderType
.NonTrailing, GenericHeaderParser.MultipleValueAuthenticationParser, null, H2StaticTable.ProxyAuthenticate);
72
public static readonly KnownHeader ProxyAuthorization = new("Proxy-Authorization",
HttpHeaderType
.Request |
HttpHeaderType
.NonTrailing, GenericHeaderParser.SingleValueAuthenticationParser, null, H2StaticTable.ProxyAuthorization);
76
public static readonly KnownHeader Range = new("Range",
HttpHeaderType
.Request |
HttpHeaderType
.NonTrailing, GenericHeaderParser.RangeParser, null, H2StaticTable.Range, H3StaticTable.RangeBytes0ToAll);
77
public static readonly KnownHeader Referer = new("Referer",
HttpHeaderType
.Request, UriHeaderParser.RelativeOrAbsoluteUriParser, null, H2StaticTable.Referer, H3StaticTable.Referer); // NB: The spelling-mistake "Referer" for "Referrer" must be matched.
80
public static readonly KnownHeader RetryAfter = new("Retry-After",
HttpHeaderType
.Response |
HttpHeaderType
.NonTrailing, GenericHeaderParser.RetryConditionParser, null, H2StaticTable.RetryAfter);
86
public static readonly KnownHeader Server = new("Server",
HttpHeaderType
.Response, ProductInfoHeaderParser.MultipleValueParser, null, H2StaticTable.Server, H3StaticTable.Server);
88
public static readonly KnownHeader SetCookie = new("Set-Cookie",
HttpHeaderType
.Custom |
HttpHeaderType
.NonTrailing, null, null, H2StaticTable.SetCookie, H3StaticTable.SetCookie);
89
public static readonly KnownHeader SetCookie2 = new("Set-Cookie2",
HttpHeaderType
.Custom |
HttpHeaderType
.NonTrailing, null);
91
public static readonly KnownHeader TE = new("TE",
HttpHeaderType
.Request |
HttpHeaderType
.NonTrailing, TransferCodingHeaderParser.MultipleValueWithQualityParser, ["trailers", "compress", "deflate", "gzip"]);
93
public static readonly KnownHeader Trailer = new("Trailer",
HttpHeaderType
.General |
HttpHeaderType
.NonTrailing, GenericHeaderParser.TokenListParser);
94
public static readonly KnownHeader TransferEncoding = new("Transfer-Encoding",
HttpHeaderType
.General |
HttpHeaderType
.NonTrailing, TransferCodingHeaderParser.MultipleValueParser, ["chunked", "compress", "deflate", "gzip", "identity"], H2StaticTable.TransferEncoding);
96
public static readonly KnownHeader Upgrade = new("Upgrade",
HttpHeaderType
.General, GenericHeaderParser.MultipleValueProductParser);
98
public static readonly KnownHeader UserAgent = new("User-Agent",
HttpHeaderType
.Request, ProductInfoHeaderParser.MultipleValueParser, null, H2StaticTable.UserAgent, H3StaticTable.UserAgent);
99
public static readonly KnownHeader Vary = new("Vary",
HttpHeaderType
.Response |
HttpHeaderType
.NonTrailing, GenericHeaderParser.TokenListParser, ["Accept-Encoding", "accept-encoding", "Origin", "Referer", "*"], H2StaticTable.Vary, H3StaticTable.VaryAcceptEncoding);
100
public static readonly KnownHeader Via = new("Via",
HttpHeaderType
.General, GenericHeaderParser.MultipleValueViaParser, null, H2StaticTable.Via);
101
public static readonly KnownHeader WWWAuthenticate = new("WWW-Authenticate",
HttpHeaderType
.Response |
HttpHeaderType
.NonTrailing, GenericHeaderParser.MultipleValueAuthenticationParser, null, H2StaticTable.WwwAuthenticate);
102
public static readonly KnownHeader Warning = new("Warning",
HttpHeaderType
.General |
HttpHeaderType
.NonTrailing, GenericHeaderParser.MultipleValueWarningParser);
System\Net\Http\SocketsHttpHandler\Http2Stream.cs (6)
712
_trailers.TryAddWithoutValidation((descriptor.HeaderType &
HttpHeaderType
.Request) ==
HttpHeaderType
.Request ? descriptor.AsCustomHeader() : descriptor, headerValue);
714
else if ((descriptor.HeaderType &
HttpHeaderType
.Content) ==
HttpHeaderType
.Content)
724
_response.Headers.TryAddWithoutValidation((descriptor.HeaderType &
HttpHeaderType
.Request) ==
HttpHeaderType
.Request ? descriptor.AsCustomHeader() : descriptor, headerValue);
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (3)
1152
case HeaderState.ResponseHeaders when descriptor.HeaderType.HasFlag(
HttpHeaderType
.Content):
1156
_response!.Headers.TryAddWithoutValidation(descriptor.HeaderType.HasFlag(
HttpHeaderType
.Request) ? descriptor.AsCustomHeader() : descriptor, headerValue);
1159
_trailingHeaders!.Add((descriptor.HeaderType.HasFlag(
HttpHeaderType
.Request) ? descriptor.AsCustomHeader() : descriptor, headerValue));
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (4)
1280
HttpHeaderType
headerType = descriptor.HeaderType;
1283
if ((headerType &
HttpHeaderType
.Request) != 0)
1293
if ((headerType &
HttpHeaderType
.NonTrailing) != 0)
1303
else if ((headerType &
HttpHeaderType
.Content) != 0)