diff --git a/src/Antiforgery/src/Internal/DefaultAntiforgery.cs b/src/Antiforgery/src/Internal/DefaultAntiforgery.cs
index 8259fd540ddf..030f79c07efc 100644
--- a/src/Antiforgery/src/Internal/DefaultAntiforgery.cs
+++ b/src/Antiforgery/src/Internal/DefaultAntiforgery.cs
@@ -263,12 +263,12 @@ private void SaveCookieTokenAndHeader(HttpContext httpContext, string cookieToke
_tokenStore.SaveCookieToken(httpContext, cookieToken);
}
- if (!_options.SuppressXFrameOptionsHeader && !httpContext.Response.Headers.ContainsKey("X-Frame-Options"))
+ if (!_options.SuppressXFrameOptionsHeader && !httpContext.Response.Headers.ContainsKey(HeaderNames.XFrameOptions))
{
// Adding X-Frame-Options header to prevent ClickJacking. See
// http://tools.ietf.org/html/draft-ietf-websec-x-frame-options-10
// for more information.
- httpContext.Response.Headers["X-Frame-Options"] = "SAMEORIGIN";
+ httpContext.Response.Headers[HeaderNames.XFrameOptions] = "SAMEORIGIN";
}
}
diff --git a/src/Hosting/Hosting/src/GenericHost/GenericWebHostedService.cs b/src/Hosting/Hosting/src/GenericHost/GenericWebHostedService.cs
index 816f70deb9e7..4d6ccf6fb007 100644
--- a/src/Hosting/Hosting/src/GenericHost/GenericWebHostedService.cs
+++ b/src/Hosting/Hosting/src/GenericHost/GenericWebHostedService.cs
@@ -20,6 +20,7 @@
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Microsoft.Extensions.StackTrace.Sources;
+using Microsoft.Net.Http.Headers;
namespace Microsoft.AspNetCore.Hosting.Internal
{
@@ -184,7 +185,7 @@ private RequestDelegate BuildErrorPageApplication(Exception exception)
return context =>
{
context.Response.StatusCode = 500;
- context.Response.Headers["Cache-Control"] = "no-cache";
+ context.Response.Headers[HeaderNames.CacheControl] = "no-cache";
return errorPage.ExecuteAsync(context);
};
}
diff --git a/src/Hosting/Hosting/src/Internal/HostingApplicationDiagnostics.cs b/src/Hosting/Hosting/src/Internal/HostingApplicationDiagnostics.cs
index 44802f651ecf..84653599ee7c 100644
--- a/src/Hosting/Hosting/src/Internal/HostingApplicationDiagnostics.cs
+++ b/src/Hosting/Hosting/src/Internal/HostingApplicationDiagnostics.cs
@@ -22,11 +22,6 @@ internal class HostingApplicationDiagnostics
private const string DeprecatedDiagnosticsEndRequestKey = "Microsoft.AspNetCore.Hosting.EndRequest";
private const string DiagnosticsUnhandledExceptionKey = "Microsoft.AspNetCore.Hosting.UnhandledException";
- private const string RequestIdHeaderName = "Request-Id";
- private const string CorrelationContextHeaderName = "Correlation-Context";
- private const string TraceParentHeaderName = "traceparent";
- private const string TraceStateHeaderName = "tracestate";
-
private readonly DiagnosticListener _diagnosticListener;
private readonly ILogger _logger;
@@ -238,22 +233,22 @@ private Activity StartActivity(HttpContext httpContext)
{
var activity = new Activity(ActivityName);
- if (!httpContext.Request.Headers.TryGetValue(TraceParentHeaderName, out var requestId))
+ if (!httpContext.Request.Headers.TryGetValue(HeaderNames.TraceParent, out var requestId))
{
- httpContext.Request.Headers.TryGetValue(RequestIdHeaderName, out requestId);
+ httpContext.Request.Headers.TryGetValue(HeaderNames.RequestId, out requestId);
}
if (!StringValues.IsNullOrEmpty(requestId))
{
activity.SetParentId(requestId);
- if (httpContext.Request.Headers.TryGetValue(TraceStateHeaderName, out var traceState))
+ if (httpContext.Request.Headers.TryGetValue(HeaderNames.TraceState, out var traceState))
{
activity.TraceStateString = traceState;
}
// We expect baggage to be empty by default
// Only very advanced users will be using it in near future, we encourage them to keep baggage small (few items)
- string[] baggage = httpContext.Request.Headers.GetCommaSeparatedValues(CorrelationContextHeaderName);
+ string[] baggage = httpContext.Request.Headers.GetCommaSeparatedValues(HeaderNames.CorrelationContext);
if (baggage.Length > 0)
{
foreach (var item in baggage)
diff --git a/src/Hosting/Hosting/src/Internal/WebHost.cs b/src/Hosting/Hosting/src/Internal/WebHost.cs
index 8dcfa065150c..1aa779ee3719 100644
--- a/src/Hosting/Hosting/src/Internal/WebHost.cs
+++ b/src/Hosting/Hosting/src/Internal/WebHost.cs
@@ -22,6 +22,7 @@
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.StackTrace.Sources;
+using Microsoft.Net.Http.Headers;
namespace Microsoft.AspNetCore.Hosting.Internal
{
@@ -276,7 +277,7 @@ private RequestDelegate BuildApplication()
return context =>
{
context.Response.StatusCode = 500;
- context.Response.Headers["Cache-Control"] = "no-cache";
+ context.Response.Headers[HeaderNames.CacheControl] = "no-cache";
return errorPage.ExecuteAsync(context);
};
}
diff --git a/src/Http/Headers/ref/Microsoft.Net.Http.Headers.netcoreapp3.0.cs b/src/Http/Headers/ref/Microsoft.Net.Http.Headers.netcoreapp3.0.cs
index e2b93d100332..838497b88fcf 100644
--- a/src/Http/Headers/ref/Microsoft.Net.Http.Headers.netcoreapp3.0.cs
+++ b/src/Http/Headers/ref/Microsoft.Net.Http.Headers.netcoreapp3.0.cs
@@ -118,74 +118,87 @@ public EntityTagHeaderValue(Microsoft.Extensions.Primitives.StringSegment tag, b
}
public static partial class HeaderNames
{
- public const string Accept = "Accept";
- public const string AcceptCharset = "Accept-Charset";
- public const string AcceptEncoding = "Accept-Encoding";
- public const string AcceptLanguage = "Accept-Language";
- public const string AcceptRanges = "Accept-Ranges";
- public const string AccessControlAllowCredentials = "Access-Control-Allow-Credentials";
- public const string AccessControlAllowHeaders = "Access-Control-Allow-Headers";
- public const string AccessControlAllowMethods = "Access-Control-Allow-Methods";
- public const string AccessControlAllowOrigin = "Access-Control-Allow-Origin";
- public const string AccessControlExposeHeaders = "Access-Control-Expose-Headers";
- public const string AccessControlMaxAge = "Access-Control-Max-Age";
- public const string AccessControlRequestHeaders = "Access-Control-Request-Headers";
- public const string AccessControlRequestMethod = "Access-Control-Request-Method";
- public const string Age = "Age";
- public const string Allow = "Allow";
- public const string Authority = ":authority";
- public const string Authorization = "Authorization";
- public const string CacheControl = "Cache-Control";
- public const string Connection = "Connection";
- public const string ContentDisposition = "Content-Disposition";
- public const string ContentEncoding = "Content-Encoding";
- public const string ContentLanguage = "Content-Language";
- public const string ContentLength = "Content-Length";
- public const string ContentLocation = "Content-Location";
- public const string ContentMD5 = "Content-MD5";
- public const string ContentRange = "Content-Range";
- public const string ContentSecurityPolicy = "Content-Security-Policy";
- public const string ContentSecurityPolicyReportOnly = "Content-Security-Policy-Report-Only";
- public const string ContentType = "Content-Type";
- public const string Cookie = "Cookie";
- public const string Date = "Date";
- public const string ETag = "ETag";
- public const string Expect = "Expect";
- public const string Expires = "Expires";
- public const string From = "From";
- public const string Host = "Host";
- public const string IfMatch = "If-Match";
- public const string IfModifiedSince = "If-Modified-Since";
- public const string IfNoneMatch = "If-None-Match";
- public const string IfRange = "If-Range";
- public const string IfUnmodifiedSince = "If-Unmodified-Since";
- public const string LastModified = "Last-Modified";
- public const string Location = "Location";
- public const string MaxForwards = "Max-Forwards";
- public const string Method = ":method";
- public const string Origin = "Origin";
- public const string Path = ":path";
- public const string Pragma = "Pragma";
- public const string ProxyAuthenticate = "Proxy-Authenticate";
- public const string ProxyAuthorization = "Proxy-Authorization";
- public const string Range = "Range";
- public const string Referer = "Referer";
- public const string RetryAfter = "Retry-After";
- public const string Scheme = ":scheme";
- public const string Server = "Server";
- public const string SetCookie = "Set-Cookie";
- public const string Status = ":status";
- public const string StrictTransportSecurity = "Strict-Transport-Security";
- public const string TE = "TE";
- public const string Trailer = "Trailer";
- public const string TransferEncoding = "Transfer-Encoding";
- public const string Upgrade = "Upgrade";
- public const string UserAgent = "User-Agent";
- public const string Vary = "Vary";
- public const string Via = "Via";
- public const string Warning = "Warning";
- public const string WebSocketSubProtocols = "Sec-WebSocket-Protocol";
- public const string WWWAuthenticate = "WWW-Authenticate";
+ public static readonly string Accept;
+ public static readonly string AcceptCharset;
+ public static readonly string AcceptEncoding;
+ public static readonly string AcceptLanguage;
+ public static readonly string AcceptRanges;
+ public static readonly string AccessControlAllowCredentials;
+ public static readonly string AccessControlAllowHeaders;
+ public static readonly string AccessControlAllowMethods;
+ public static readonly string AccessControlAllowOrigin;
+ public static readonly string AccessControlExposeHeaders;
+ public static readonly string AccessControlMaxAge;
+ public static readonly string AccessControlRequestHeaders;
+ public static readonly string AccessControlRequestMethod;
+ public static readonly string Age;
+ public static readonly string Allow;
+ public static readonly string Authority;
+ public static readonly string Authorization;
+ public static readonly string CacheControl;
+ public static readonly string Connection;
+ public static readonly string ContentDisposition;
+ public static readonly string ContentEncoding;
+ public static readonly string ContentLanguage;
+ public static readonly string ContentLength;
+ public static readonly string ContentLocation;
+ public static readonly string ContentMD5;
+ public static readonly string ContentRange;
+ public static readonly string ContentSecurityPolicy;
+ public static readonly string ContentSecurityPolicyReportOnly;
+ public static readonly string ContentType;
+ public static readonly string Cookie;
+ public static readonly string CorrelationContext;
+ public static readonly string Date;
+ public static readonly string DNT;
+ public static readonly string ETag;
+ public static readonly string Expect;
+ public static readonly string Expires;
+ public static readonly string From;
+ public static readonly string Host;
+ public static readonly string IfMatch;
+ public static readonly string IfModifiedSince;
+ public static readonly string IfNoneMatch;
+ public static readonly string IfRange;
+ public static readonly string IfUnmodifiedSince;
+ public static readonly string KeepAlive;
+ public static readonly string LastModified;
+ public static readonly string Location;
+ public static readonly string MaxForwards;
+ public static readonly string Method;
+ public static readonly string Origin;
+ public static readonly string Path;
+ public static readonly string Pragma;
+ public static readonly string ProxyAuthenticate;
+ public static readonly string ProxyAuthorization;
+ public static readonly string Range;
+ public static readonly string Referer;
+ public static readonly string RequestId;
+ public static readonly string RetryAfter;
+ public static readonly string Scheme;
+ public static readonly string SecWebSocketAccept;
+ public static readonly string SecWebSocketKey;
+ public static readonly string SecWebSocketProtocol;
+ public static readonly string SecWebSocketVersion;
+ public static readonly string Server;
+ public static readonly string SetCookie;
+ public static readonly string Status;
+ public static readonly string StrictTransportSecurity;
+ public static readonly string TE;
+ public static readonly string TraceParent;
+ public static readonly string TraceState;
+ public static readonly string Trailer;
+ public static readonly string TransferEncoding;
+ public static readonly string Translate;
+ public static readonly string Upgrade;
+ public static readonly string UpgradeInsecureRequests;
+ public static readonly string UserAgent;
+ public static readonly string Vary;
+ public static readonly string Via;
+ public static readonly string Warning;
+ public static readonly string WebSocketSubProtocols;
+ public static readonly string WWWAuthenticate;
+ public static readonly string XFrameOptions;
}
public static partial class HeaderQuality
{
diff --git a/src/Http/Headers/src/HeaderNames.cs b/src/Http/Headers/src/HeaderNames.cs
index fe79d242e8a3..602916254ac4 100644
--- a/src/Http/Headers/src/HeaderNames.cs
+++ b/src/Http/Headers/src/HeaderNames.cs
@@ -5,73 +5,87 @@ namespace Microsoft.Net.Http.Headers
{
public static class HeaderNames
{
- public const string Accept = "Accept";
- public const string AcceptCharset = "Accept-Charset";
- public const string AcceptEncoding = "Accept-Encoding";
- public const string AcceptLanguage = "Accept-Language";
- public const string AcceptRanges = "Accept-Ranges";
- public const string AccessControlAllowCredentials = "Access-Control-Allow-Credentials";
- public const string AccessControlAllowHeaders = "Access-Control-Allow-Headers";
- public const string AccessControlAllowMethods = "Access-Control-Allow-Methods";
- public const string AccessControlAllowOrigin = "Access-Control-Allow-Origin";
- public const string AccessControlExposeHeaders = "Access-Control-Expose-Headers";
- public const string AccessControlMaxAge = "Access-Control-Max-Age";
- public const string AccessControlRequestHeaders = "Access-Control-Request-Headers";
- public const string AccessControlRequestMethod = "Access-Control-Request-Method";
- public const string Age = "Age";
- public const string Allow = "Allow";
- public const string Authority = ":authority";
- public const string Authorization = "Authorization";
- public const string CacheControl = "Cache-Control";
- public const string Connection = "Connection";
- public const string ContentDisposition = "Content-Disposition";
- public const string ContentEncoding = "Content-Encoding";
- public const string ContentLanguage = "Content-Language";
- public const string ContentLength = "Content-Length";
- public const string ContentLocation = "Content-Location";
- public const string ContentMD5 = "Content-MD5";
- public const string ContentRange = "Content-Range";
- public const string ContentSecurityPolicy = "Content-Security-Policy";
- public const string ContentSecurityPolicyReportOnly = "Content-Security-Policy-Report-Only";
- public const string ContentType = "Content-Type";
- public const string Cookie = "Cookie";
- public const string Date = "Date";
- public const string ETag = "ETag";
- public const string Expires = "Expires";
- public const string Expect = "Expect";
- public const string From = "From";
- public const string Host = "Host";
- public const string IfMatch = "If-Match";
- public const string IfModifiedSince = "If-Modified-Since";
- public const string IfNoneMatch = "If-None-Match";
- public const string IfRange = "If-Range";
- public const string IfUnmodifiedSince = "If-Unmodified-Since";
- public const string LastModified = "Last-Modified";
- public const string Location = "Location";
- public const string MaxForwards = "Max-Forwards";
- public const string Method = ":method";
- public const string Origin = "Origin";
- public const string Path = ":path";
- public const string Pragma = "Pragma";
- public const string ProxyAuthenticate = "Proxy-Authenticate";
- public const string ProxyAuthorization = "Proxy-Authorization";
- public const string Range = "Range";
- public const string Referer = "Referer";
- public const string RetryAfter = "Retry-After";
- public const string Scheme = ":scheme";
- public const string Server = "Server";
- public const string SetCookie = "Set-Cookie";
- public const string Status = ":status";
- public const string StrictTransportSecurity = "Strict-Transport-Security";
- public const string TE = "TE";
- public const string Trailer = "Trailer";
- public const string TransferEncoding = "Transfer-Encoding";
- public const string Upgrade = "Upgrade";
- public const string UserAgent = "User-Agent";
- public const string Vary = "Vary";
- public const string Via = "Via";
- public const string Warning = "Warning";
- public const string WebSocketSubProtocols = "Sec-WebSocket-Protocol";
- public const string WWWAuthenticate = "WWW-Authenticate";
+ // Use readonly statics rather than constants so ReferenceEquals works
+ public static readonly string Accept = "Accept";
+ public static readonly string AcceptCharset = "Accept-Charset";
+ public static readonly string AcceptEncoding = "Accept-Encoding";
+ public static readonly string AcceptLanguage = "Accept-Language";
+ public static readonly string AcceptRanges = "Accept-Ranges";
+ public static readonly string AccessControlAllowCredentials = "Access-Control-Allow-Credentials";
+ public static readonly string AccessControlAllowHeaders = "Access-Control-Allow-Headers";
+ public static readonly string AccessControlAllowMethods = "Access-Control-Allow-Methods";
+ public static readonly string AccessControlAllowOrigin = "Access-Control-Allow-Origin";
+ public static readonly string AccessControlExposeHeaders = "Access-Control-Expose-Headers";
+ public static readonly string AccessControlMaxAge = "Access-Control-Max-Age";
+ public static readonly string AccessControlRequestHeaders = "Access-Control-Request-Headers";
+ public static readonly string AccessControlRequestMethod = "Access-Control-Request-Method";
+ public static readonly string Age = "Age";
+ public static readonly string Allow = "Allow";
+ public static readonly string Authority = ":authority";
+ public static readonly string Authorization = "Authorization";
+ public static readonly string CacheControl = "Cache-Control";
+ public static readonly string Connection = "Connection";
+ public static readonly string ContentDisposition = "Content-Disposition";
+ public static readonly string ContentEncoding = "Content-Encoding";
+ public static readonly string ContentLanguage = "Content-Language";
+ public static readonly string ContentLength = "Content-Length";
+ public static readonly string ContentLocation = "Content-Location";
+ public static readonly string ContentMD5 = "Content-MD5";
+ public static readonly string ContentRange = "Content-Range";
+ public static readonly string ContentSecurityPolicy = "Content-Security-Policy";
+ public static readonly string ContentSecurityPolicyReportOnly = "Content-Security-Policy-Report-Only";
+ public static readonly string ContentType = "Content-Type";
+ public static readonly string CorrelationContext = "Correlation-Context";
+ public static readonly string Cookie = "Cookie";
+ public static readonly string Date = "Date";
+ public static readonly string DNT = "DNT";
+ public static readonly string ETag = "ETag";
+ public static readonly string Expires = "Expires";
+ public static readonly string Expect = "Expect";
+ public static readonly string From = "From";
+ public static readonly string Host = "Host";
+ public static readonly string KeepAlive = "Keep-Alive";
+ public static readonly string IfMatch = "If-Match";
+ public static readonly string IfModifiedSince = "If-Modified-Since";
+ public static readonly string IfNoneMatch = "If-None-Match";
+ public static readonly string IfRange = "If-Range";
+ public static readonly string IfUnmodifiedSince = "If-Unmodified-Since";
+ public static readonly string LastModified = "Last-Modified";
+ public static readonly string Location = "Location";
+ public static readonly string MaxForwards = "Max-Forwards";
+ public static readonly string Method = ":method";
+ public static readonly string Origin = "Origin";
+ public static readonly string Path = ":path";
+ public static readonly string Pragma = "Pragma";
+ public static readonly string ProxyAuthenticate = "Proxy-Authenticate";
+ public static readonly string ProxyAuthorization = "Proxy-Authorization";
+ public static readonly string Range = "Range";
+ public static readonly string Referer = "Referer";
+ public static readonly string RetryAfter = "Retry-After";
+ public static readonly string RequestId = "Request-Id";
+ public static readonly string Scheme = ":scheme";
+ public static readonly string SecWebSocketAccept = "Sec-WebSocket-Accept";
+ public static readonly string SecWebSocketKey = "Sec-WebSocket-Key";
+ public static readonly string SecWebSocketProtocol = "Sec-WebSocket-Protocol";
+ public static readonly string SecWebSocketVersion = "Sec-WebSocket-Version";
+ public static readonly string Server = "Server";
+ public static readonly string SetCookie = "Set-Cookie";
+ public static readonly string Status = ":status";
+ public static readonly string StrictTransportSecurity = "Strict-Transport-Security";
+ public static readonly string TE = "TE";
+ public static readonly string Trailer = "Trailer";
+ public static readonly string TransferEncoding = "Transfer-Encoding";
+ public static readonly string Translate = "Translate";
+ public static readonly string TraceParent = "traceparent";
+ public static readonly string TraceState = "tracestate";
+ public static readonly string Upgrade = "Upgrade";
+ public static readonly string UpgradeInsecureRequests = "Upgrade-Insecure-Requests";
+ public static readonly string UserAgent = "User-Agent";
+ public static readonly string Vary = "Vary";
+ public static readonly string Via = "Via";
+ public static readonly string Warning = "Warning";
+ public static readonly string WebSocketSubProtocols = "Sec-WebSocket-Protocol";
+ public static readonly string WWWAuthenticate = "WWW-Authenticate";
+ public static readonly string XFrameOptions = "X-Frame-Options";
}
}
diff --git a/src/Http/Http.Abstractions/ref/Microsoft.AspNetCore.Http.Abstractions.csproj b/src/Http/Http.Abstractions/ref/Microsoft.AspNetCore.Http.Abstractions.csproj
index 6c6e2c7739e9..d4db5e191949 100644
--- a/src/Http/Http.Abstractions/ref/Microsoft.AspNetCore.Http.Abstractions.csproj
+++ b/src/Http/Http.Abstractions/ref/Microsoft.AspNetCore.Http.Abstractions.csproj
@@ -7,6 +7,7 @@
+
diff --git a/src/Http/Http.Abstractions/src/Extensions/ResponseTrailerExtensions.cs b/src/Http/Http.Abstractions/src/Extensions/ResponseTrailerExtensions.cs
index 745cbfd9de47..684dcdd164df 100644
--- a/src/Http/Http.Abstractions/src/Extensions/ResponseTrailerExtensions.cs
+++ b/src/Http/Http.Abstractions/src/Extensions/ResponseTrailerExtensions.cs
@@ -4,13 +4,12 @@
using System;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.Extensions.Primitives;
+using Microsoft.Net.Http.Headers;
namespace Microsoft.AspNetCore.Http
{
public static class ResponseTrailerExtensions
{
- private const string Trailer = "Trailer";
-
///
/// Adds the given trailer name to the 'Trailer' response header. This must happen before the response headers are sent.
///
@@ -18,7 +17,7 @@ public static class ResponseTrailerExtensions
///
public static void DeclareTrailer(this HttpResponse response, string trailerName)
{
- response.Headers.AppendCommaSeparatedValues(Trailer, trailerName);
+ response.Headers.AppendCommaSeparatedValues(HeaderNames.Trailer, trailerName);
}
///
diff --git a/src/Http/Http.Abstractions/src/Microsoft.AspNetCore.Http.Abstractions.csproj b/src/Http/Http.Abstractions/src/Microsoft.AspNetCore.Http.Abstractions.csproj
index bfe8d8399f9a..d5b065b3d855 100644
--- a/src/Http/Http.Abstractions/src/Microsoft.AspNetCore.Http.Abstractions.csproj
+++ b/src/Http/Http.Abstractions/src/Microsoft.AspNetCore.Http.Abstractions.csproj
@@ -22,6 +22,7 @@ Microsoft.AspNetCore.Http.HttpResponse
+
diff --git a/src/Http/Http/src/Internal/DefaultHttpRequest.cs b/src/Http/Http/src/Internal/DefaultHttpRequest.cs
index b82359e9859b..964a4785104d 100644
--- a/src/Http/Http/src/Internal/DefaultHttpRequest.cs
+++ b/src/Http/Http/src/Internal/DefaultHttpRequest.cs
@@ -116,8 +116,8 @@ public override bool IsHttps
public override HostString Host
{
- get { return HostString.FromUriComponent(Headers["Host"]); }
- set { Headers["Host"] = value.ToUriComponent(); }
+ get { return HostString.FromUriComponent(Headers[HeaderNames.Host]); }
+ set { Headers[HeaderNames.Host] = value.ToUriComponent(); }
}
public override IQueryCollection Query
diff --git a/src/Http/Http/src/Internal/FormFile.cs b/src/Http/Http/src/Internal/FormFile.cs
index b4a3f4d91f40..fe541ae85702 100644
--- a/src/Http/Http/src/Internal/FormFile.cs
+++ b/src/Http/Http/src/Internal/FormFile.cs
@@ -5,6 +5,7 @@
using System.IO;
using System.Threading;
using System.Threading.Tasks;
+using Microsoft.Net.Http.Headers;
namespace Microsoft.AspNetCore.Http.Internal
{
@@ -30,8 +31,8 @@ public FormFile(Stream baseStream, long baseStreamOffset, long length, string na
///
public string ContentDisposition
{
- get { return Headers["Content-Disposition"]; }
- set { Headers["Content-Disposition"] = value; }
+ get { return Headers[HeaderNames.ContentDisposition]; }
+ set { Headers[HeaderNames.ContentDisposition] = value; }
}
///
@@ -39,8 +40,8 @@ public string ContentDisposition
///
public string ContentType
{
- get { return Headers["Content-Type"]; }
- set { Headers["Content-Type"] = value; }
+ get { return Headers[HeaderNames.ContentType]; }
+ set { Headers[HeaderNames.ContentType] = value; }
}
///
diff --git a/src/Http/Routing/src/Matching/HttpMethodMatcherPolicy.cs b/src/Http/Routing/src/Matching/HttpMethodMatcherPolicy.cs
index 6e7d2d069b0c..3111c55a67a4 100644
--- a/src/Http/Routing/src/Matching/HttpMethodMatcherPolicy.cs
+++ b/src/Http/Routing/src/Matching/HttpMethodMatcherPolicy.cs
@@ -391,7 +391,7 @@ private Endpoint CreateRejectionEndpoint(IEnumerable httpMethods)
// Prevent ArgumentException from duplicate key if header already added, such as when the
// request is re-executed by an error handler (see https://github.com/aspnet/AspNetCore/issues/6415)
- context.Response.Headers["Allow"] = allow;
+ context.Response.Headers[HeaderNames.Allow] = allow;
return Task.CompletedTask;
},
diff --git a/src/Http/WebUtilities/src/MultipartSection.cs b/src/Http/WebUtilities/src/MultipartSection.cs
index 96138c630a10..cba78617d16b 100644
--- a/src/Http/WebUtilities/src/MultipartSection.cs
+++ b/src/Http/WebUtilities/src/MultipartSection.cs
@@ -4,6 +4,7 @@
using System.Collections.Generic;
using System.IO;
using Microsoft.Extensions.Primitives;
+using Microsoft.Net.Http.Headers;
namespace Microsoft.AspNetCore.WebUtilities
{
@@ -14,7 +15,7 @@ public string ContentType
get
{
StringValues values;
- if (Headers.TryGetValue("Content-Type", out values))
+ if (Headers.TryGetValue(HeaderNames.ContentType, out values))
{
return values;
}
@@ -27,7 +28,7 @@ public string ContentDisposition
get
{
StringValues values;
- if (Headers.TryGetValue("Content-Disposition", out values))
+ if (Headers.TryGetValue(HeaderNames.ContentDisposition, out values))
{
return values;
}
@@ -45,4 +46,4 @@ public string ContentDisposition
///
public long? BaseStreamOffset { get; set; }
}
-}
\ No newline at end of file
+}
diff --git a/src/Middleware/Session/src/SessionMiddleware.cs b/src/Middleware/Session/src/SessionMiddleware.cs
index bd74afa9cb52..d3eceb4d2bd7 100644
--- a/src/Middleware/Session/src/SessionMiddleware.cs
+++ b/src/Middleware/Session/src/SessionMiddleware.cs
@@ -11,6 +11,7 @@
using Microsoft.AspNetCore.Http.Features;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
+using Microsoft.Net.Http.Headers;
namespace Microsoft.AspNetCore.Session
{
@@ -159,9 +160,9 @@ private void SetCookie()
_context.Response.Cookies.Append(_options.Cookie.Name, _cookieValue, cookieOptions);
- _context.Response.Headers["Cache-Control"] = "no-cache";
- _context.Response.Headers["Pragma"] = "no-cache";
- _context.Response.Headers["Expires"] = "-1";
+ _context.Response.Headers[HeaderNames.CacheControl] = "no-cache";
+ _context.Response.Headers[HeaderNames.Pragma] = "no-cache";
+ _context.Response.Headers[HeaderNames.Expires] = "-1";
}
// Returns true if the session has already been established, or if it still can be because the response has not been sent.
@@ -171,4 +172,4 @@ internal bool TryEstablishSession()
}
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Middleware/WebSockets/ref/Microsoft.AspNetCore.WebSockets.netcoreapp3.0.cs b/src/Middleware/WebSockets/ref/Microsoft.AspNetCore.WebSockets.netcoreapp3.0.cs
index f0cec99aabe7..6b2b1988b3af 100644
--- a/src/Middleware/WebSockets/ref/Microsoft.AspNetCore.WebSockets.netcoreapp3.0.cs
+++ b/src/Middleware/WebSockets/ref/Microsoft.AspNetCore.WebSockets.netcoreapp3.0.cs
@@ -35,21 +35,3 @@ public static partial class WebSocketsDependencyInjectionExtensions
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddWebSockets(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Action configure) { throw null; }
}
}
-namespace Microsoft.AspNetCore.WebSockets.Internal
-{
- public static partial class Constants
- {
- public static partial class Headers
- {
- public const string Connection = "Connection";
- public const string ConnectionUpgrade = "Upgrade";
- public const string SecWebSocketAccept = "Sec-WebSocket-Accept";
- public const string SecWebSocketKey = "Sec-WebSocket-Key";
- public const string SecWebSocketProtocol = "Sec-WebSocket-Protocol";
- public const string SecWebSocketVersion = "Sec-WebSocket-Version";
- public const string SupportedVersion = "13";
- public const string Upgrade = "Upgrade";
- public const string UpgradeWebSocket = "websocket";
- }
- }
-}
diff --git a/src/Middleware/WebSockets/src/Internal/Constants.cs b/src/Middleware/WebSockets/src/Internal/Constants.cs
index ffc5db2c14b6..8fb17cf9c0e9 100644
--- a/src/Middleware/WebSockets/src/Internal/Constants.cs
+++ b/src/Middleware/WebSockets/src/Internal/Constants.cs
@@ -3,18 +3,12 @@
namespace Microsoft.AspNetCore.WebSockets.Internal
{
- public static class Constants
+ internal static class Constants
{
public static class Headers
- {
- public const string Upgrade = "Upgrade";
- public const string UpgradeWebSocket = "websocket";
- public const string Connection = "Connection";
+ {
+ public const string UpgradeWebSocket = "websocket";
public const string ConnectionUpgrade = "Upgrade";
- public const string SecWebSocketKey = "Sec-WebSocket-Key";
- public const string SecWebSocketVersion = "Sec-WebSocket-Version";
- public const string SecWebSocketProtocol = "Sec-WebSocket-Protocol";
- public const string SecWebSocketAccept = "Sec-WebSocket-Accept";
public const string SupportedVersion = "13";
}
}
diff --git a/src/Middleware/WebSockets/src/Internal/HandshakeHelpers.cs b/src/Middleware/WebSockets/src/Internal/HandshakeHelpers.cs
index c001e9318e2f..551ca879c91f 100644
--- a/src/Middleware/WebSockets/src/Internal/HandshakeHelpers.cs
+++ b/src/Middleware/WebSockets/src/Internal/HandshakeHelpers.cs
@@ -6,6 +6,7 @@
using System.Security.Cryptography;
using System.Text;
using Microsoft.AspNetCore.Http;
+using Microsoft.Net.Http.Headers;
namespace Microsoft.AspNetCore.WebSockets.Internal
{
@@ -16,10 +17,10 @@ internal static class HandshakeHelpers
///
public static readonly IEnumerable NeededHeaders = new[]
{
- Constants.Headers.Upgrade,
- Constants.Headers.Connection,
- Constants.Headers.SecWebSocketKey,
- Constants.Headers.SecWebSocketVersion
+ HeaderNames.Upgrade,
+ HeaderNames.Connection,
+ HeaderNames.SecWebSocketKey,
+ HeaderNames.SecWebSocketVersion
};
// Verify Method, Upgrade, Connection, version, key, etc..
@@ -34,28 +35,28 @@ public static bool CheckSupportedWebSocketRequest(string method, IEnumerable AcceptAsync(WebSocketAcceptContext acceptContext)
}
}
- string key = string.Join(", ", _context.Request.Headers[Constants.Headers.SecWebSocketKey]);
+ string key = string.Join(", ", _context.Request.Headers[HeaderNames.SecWebSocketKey]);
HandshakeHelpers.GenerateResponseHeaders(key, subProtocol, _context.Response.Headers);
diff --git a/src/Middleware/WebSockets/test/UnitTests/WebSocketMiddlewareTests.cs b/src/Middleware/WebSockets/test/UnitTests/WebSocketMiddlewareTests.cs
index d010a00c4b95..61b310f1b0aa 100644
--- a/src/Middleware/WebSockets/test/UnitTests/WebSocketMiddlewareTests.cs
+++ b/src/Middleware/WebSockets/test/UnitTests/WebSocketMiddlewareTests.cs
@@ -12,6 +12,7 @@
using Microsoft.AspNetCore.Testing.xunit;
using Microsoft.AspNetCore.WebSockets.Internal;
using Microsoft.Extensions.Logging.Testing;
+using Microsoft.Net.Http.Headers;
using Xunit;
namespace Microsoft.AspNetCore.WebSockets.Test
@@ -537,11 +538,11 @@ public async Task OriginIsValidatedForWebSocketRequests(HttpStatusCode expectedC
request.Headers.Connection.Clear();
request.Headers.Connection.Add("Upgrade");
request.Headers.Upgrade.Add(new System.Net.Http.Headers.ProductHeaderValue("websocket"));
- request.Headers.Add(Constants.Headers.SecWebSocketVersion, Constants.Headers.SupportedVersion);
+ request.Headers.Add(HeaderNames.SecWebSocketVersion, "13");
// SecWebSocketKey required to be 16 bytes
- request.Headers.Add(Constants.Headers.SecWebSocketKey, Convert.ToBase64String(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }, Base64FormattingOptions.None));
+ request.Headers.Add(HeaderNames.SecWebSocketKey, Convert.ToBase64String(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }, Base64FormattingOptions.None));
- request.Headers.Add("Origin", "http://example.com");
+ request.Headers.Add(HeaderNames.Origin, "http://example.com");
var response = await client.SendAsync(request);
Assert.Equal(expectedCode, response.StatusCode);
diff --git a/src/Mvc/test/Mvc.FunctionalTests/RequestServicesTestBase.cs b/src/Mvc/test/Mvc.FunctionalTests/RequestServicesTestBase.cs
index cc4e06ba74be..840d070bc258 100644
--- a/src/Mvc/test/Mvc.FunctionalTests/RequestServicesTestBase.cs
+++ b/src/Mvc/test/Mvc.FunctionalTests/RequestServicesTestBase.cs
@@ -7,6 +7,7 @@
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
+using Microsoft.Net.Http.Headers;
using Xunit;
namespace Microsoft.AspNetCore.Mvc.FunctionalTests
@@ -41,7 +42,7 @@ public async Task RequestServices(string url)
// Arrange
var requestId = Guid.NewGuid().ToString();
var request = new HttpRequestMessage(HttpMethod.Get, url);
- request.Headers.TryAddWithoutValidation("RequestId", requestId);
+ request.Headers.TryAddWithoutValidation(HeaderNames.RequestId, requestId);
// Act
var response = await Client.SendAsync(request);
@@ -64,7 +65,7 @@ public async Task RequestServices_TagHelper()
{
var requestId = Guid.NewGuid().ToString();
var request = new HttpRequestMessage(HttpMethod.Get, url);
- request.Headers.TryAddWithoutValidation("RequestId", requestId);
+ request.Headers.TryAddWithoutValidation(HeaderNames.RequestId, requestId);
var response = await Client.SendAsync(request);
@@ -84,7 +85,7 @@ public async Task RequestServices_Constraint()
// Act & Assert
var requestId1 = "b40f6ec1-8a6b-41c1-b3fe-928f581ebaf5";
var request1 = new HttpRequestMessage(HttpMethod.Get, url);
- request1.Headers.TryAddWithoutValidation("RequestId", requestId1);
+ request1.Headers.TryAddWithoutValidation(HeaderNames.RequestId, requestId1);
var response1 = await Client.SendAsync(request1);
@@ -93,7 +94,7 @@ public async Task RequestServices_Constraint()
var requestId2 = Guid.NewGuid().ToString();
var request2 = new HttpRequestMessage(HttpMethod.Get, url);
- request2.Headers.TryAddWithoutValidation("RequestId", requestId2);
+ request2.Headers.TryAddWithoutValidation(HeaderNames.RequestId, requestId2);
var response2 = await Client.SendAsync(request2);
Assert.Equal(HttpStatusCode.NotFound, response2.StatusCode);
diff --git a/src/Mvc/test/WebSites/BasicWebSite/RequestIdMiddleware.cs b/src/Mvc/test/WebSites/BasicWebSite/RequestIdMiddleware.cs
index 22d606ea91c1..fd2227bf23bf 100644
--- a/src/Mvc/test/WebSites/BasicWebSite/RequestIdMiddleware.cs
+++ b/src/Mvc/test/WebSites/BasicWebSite/RequestIdMiddleware.cs
@@ -5,6 +5,7 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Net.Http.Headers;
namespace BasicWebSite
{
@@ -26,7 +27,7 @@ public Task Invoke(HttpContext context)
throw new InvalidOperationException("RequestId should be null here");
}
- var requestId = context.Request.Headers["RequestId"];
+ var requestId = context.Request.Headers[HeaderNames.RequestId];
requestIdService.RequestId = requestId;
return _next(context);
diff --git a/src/Security/Authentication/Cookies/src/CookieAuthenticationEvents.cs b/src/Security/Authentication/Cookies/src/CookieAuthenticationEvents.cs
index 2b8b0416b3ba..a6bb4e7d1c60 100644
--- a/src/Security/Authentication/Cookies/src/CookieAuthenticationEvents.cs
+++ b/src/Security/Authentication/Cookies/src/CookieAuthenticationEvents.cs
@@ -4,6 +4,7 @@
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
+using Microsoft.Net.Http.Headers;
namespace Microsoft.AspNetCore.Authentication.Cookies
{
@@ -41,7 +42,7 @@ public class CookieAuthenticationEvents
{
if (IsAjaxRequest(context.Request))
{
- context.Response.Headers["Location"] = context.RedirectUri;
+ context.Response.Headers[HeaderNames.Location] = context.RedirectUri;
context.Response.StatusCode = 401;
}
else
@@ -58,7 +59,7 @@ public class CookieAuthenticationEvents
{
if (IsAjaxRequest(context.Request))
{
- context.Response.Headers["Location"] = context.RedirectUri;
+ context.Response.Headers[HeaderNames.Location] = context.RedirectUri;
context.Response.StatusCode = 403;
}
else
@@ -75,7 +76,7 @@ public class CookieAuthenticationEvents
{
if (IsAjaxRequest(context.Request))
{
- context.Response.Headers["Location"] = context.RedirectUri;
+ context.Response.Headers[HeaderNames.Location] = context.RedirectUri;
}
else
{
@@ -91,7 +92,7 @@ public class CookieAuthenticationEvents
{
if (IsAjaxRequest(context.Request))
{
- context.Response.Headers["Location"] = context.RedirectUri;
+ context.Response.Headers[HeaderNames.Location] = context.RedirectUri;
}
else
{
@@ -155,4 +156,4 @@ private static bool IsAjaxRequest(HttpRequest request)
/// Contains information about the event
public virtual Task RedirectToAccessDenied(RedirectContext context) => OnRedirectToAccessDenied(context);
}
-}
\ No newline at end of file
+}
diff --git a/src/Security/Authentication/JwtBearer/src/JwtBearerHandler.cs b/src/Security/Authentication/JwtBearer/src/JwtBearerHandler.cs
index 72d3a3bd2903..8fcc6eb50cbc 100644
--- a/src/Security/Authentication/JwtBearer/src/JwtBearerHandler.cs
+++ b/src/Security/Authentication/JwtBearer/src/JwtBearerHandler.cs
@@ -63,7 +63,7 @@ protected override async Task HandleAuthenticateAsync()
if (string.IsNullOrEmpty(token))
{
- string authorization = Request.Headers["Authorization"];
+ string authorization = Request.Headers[HeaderNames.Authorization];
// If no authorization header found, nothing to process further
if (string.IsNullOrEmpty(authorization))
diff --git a/src/Servers/Kestrel/Core/src/Internal/Http/HttpHeaders.Generated.cs b/src/Servers/Kestrel/Core/src/Internal/Http/HttpHeaders.Generated.cs
index 55882f905d44..6c85c81a68b0 100644
--- a/src/Servers/Kestrel/Core/src/Internal/Http/HttpHeaders.Generated.cs
+++ b/src/Servers/Kestrel/Core/src/Internal/Http/HttpHeaders.Generated.cs
@@ -737,20 +737,88 @@ public StringValues HeaderUpgradeInsecureRequests
_headers._UpgradeInsecureRequests = value;
}
}
- public StringValues HeaderOrigin
+ public StringValues HeaderRequestId
{
get
{
StringValues value = default;
if ((_bits & 0x40000000000L) != 0)
{
- value = _headers._Origin;
+ value = _headers._RequestId;
}
return value;
}
set
{
_bits |= 0x40000000000L;
+ _headers._RequestId = value;
+ }
+ }
+ public StringValues HeaderCorrelationContext
+ {
+ get
+ {
+ StringValues value = default;
+ if ((_bits & 0x80000000000L) != 0)
+ {
+ value = _headers._CorrelationContext;
+ }
+ return value;
+ }
+ set
+ {
+ _bits |= 0x80000000000L;
+ _headers._CorrelationContext = value;
+ }
+ }
+ public StringValues HeaderTraceParent
+ {
+ get
+ {
+ StringValues value = default;
+ if ((_bits & 0x100000000000L) != 0)
+ {
+ value = _headers._TraceParent;
+ }
+ return value;
+ }
+ set
+ {
+ _bits |= 0x100000000000L;
+ _headers._TraceParent = value;
+ }
+ }
+ public StringValues HeaderTraceState
+ {
+ get
+ {
+ StringValues value = default;
+ if ((_bits & 0x200000000000L) != 0)
+ {
+ value = _headers._TraceState;
+ }
+ return value;
+ }
+ set
+ {
+ _bits |= 0x200000000000L;
+ _headers._TraceState = value;
+ }
+ }
+ public StringValues HeaderOrigin
+ {
+ get
+ {
+ StringValues value = default;
+ if ((_bits & 0x400000000000L) != 0)
+ {
+ value = _headers._Origin;
+ }
+ return value;
+ }
+ set
+ {
+ _bits |= 0x400000000000L;
_headers._Origin = value;
}
}
@@ -759,7 +827,7 @@ public StringValues HeaderAccessControlRequestMethod
get
{
StringValues value = default;
- if ((_bits & 0x80000000000L) != 0)
+ if ((_bits & 0x800000000000L) != 0)
{
value = _headers._AccessControlRequestMethod;
}
@@ -767,7 +835,7 @@ public StringValues HeaderAccessControlRequestMethod
}
set
{
- _bits |= 0x80000000000L;
+ _bits |= 0x800000000000L;
_headers._AccessControlRequestMethod = value;
}
}
@@ -776,7 +844,7 @@ public StringValues HeaderAccessControlRequestHeaders
get
{
StringValues value = default;
- if ((_bits & 0x100000000000L) != 0)
+ if ((_bits & 0x1000000000000L) != 0)
{
value = _headers._AccessControlRequestHeaders;
}
@@ -784,7 +852,7 @@ public StringValues HeaderAccessControlRequestHeaders
}
set
{
- _bits |= 0x100000000000L;
+ _bits |= 0x1000000000000L;
_headers._AccessControlRequestHeaders = value;
}
}
@@ -815,5948 +883,9391 @@ protected override bool TryGetValueFast(string key, out StringValues value)
value = default;
switch (key.Length)
{
- case 13:
+ case 2:
+ {
+ if (ReferenceEquals(HeaderNames.TE, key))
{
- if ("Cache-Control".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x2000000000L) != 0)
{
- if ((_bits & 0x1L) != 0)
- {
- value = _headers._CacheControl;
- return true;
- }
- return false;
+ value = _headers._TE;
+ return true;
}
- if ("Content-Range".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+
+ if (HeaderNames.TE.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x2000000000L) != 0)
{
- if ((_bits & 0x10000L) != 0)
- {
- value = _headers._ContentRange;
- return true;
- }
- return false;
+ value = _headers._TE;
+ return true;
}
- if ("Last-Modified".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ break;
+ }
+ case 3:
+ {
+ if (ReferenceEquals(HeaderNames.Via, key))
+ {
+ if ((_bits & 0x100L) != 0)
{
- if ((_bits & 0x40000L) != 0)
- {
- value = _headers._LastModified;
- return true;
- }
- return false;
+ value = _headers._Via;
+ return true;
}
- if ("Authorization".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ if (ReferenceEquals(HeaderNames.DNT, key))
+ {
+ if ((_bits & 0x10000000000L) != 0)
{
- if ((_bits & 0x800000L) != 0)
- {
- value = _headers._Authorization;
- return true;
- }
- return false;
+ value = _headers._DNT;
+ return true;
+ }
+ return false;
+ }
+
+ if (HeaderNames.Via.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x100L) != 0)
+ {
+ value = _headers._Via;
+ return true;
}
- if ("If-None-Match".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ if (HeaderNames.DNT.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x10000000000L) != 0)
{
- if ((_bits & 0x40000000L) != 0)
- {
- value = _headers._IfNoneMatch;
- return true;
- }
- return false;
+ value = _headers._DNT;
+ return true;
}
+ return false;
}
break;
- case 10:
+ }
+ case 4:
+ {
+ if (ReferenceEquals(HeaderNames.Host, key))
{
- if ("Connection".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x8000000L) != 0)
{
- if ((_bits & 0x2L) != 0)
- {
- value = _headers._Connection;
- return true;
- }
- return false;
+ value = _headers._Host;
+ return true;
}
- if ("Keep-Alive".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ if (ReferenceEquals(HeaderNames.Date, key))
+ {
+ if ((_bits & 0x4L) != 0)
{
- if ((_bits & 0x8L) != 0)
- {
- value = _headers._KeepAlive;
- return true;
- }
- return false;
+ value = _headers._Date;
+ return true;
}
- if ("User-Agent".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ if (ReferenceEquals(HeaderNames.From, key))
+ {
+ if ((_bits & 0x4000000L) != 0)
{
- if ((_bits & 0x8000000000L) != 0)
- {
- value = _headers._UserAgent;
- return true;
- }
- return false;
+ value = _headers._From;
+ return true;
}
+ return false;
}
- break;
- case 4:
+
+ if (HeaderNames.Host.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ("Date".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x8000000L) != 0)
{
- if ((_bits & 0x4L) != 0)
- {
- value = _headers._Date;
- return true;
- }
- return false;
+ value = _headers._Host;
+ return true;
}
- if ("From".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ if (HeaderNames.Date.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x4L) != 0)
{
- if ((_bits & 0x4000000L) != 0)
- {
- value = _headers._From;
- return true;
- }
- return false;
+ value = _headers._Date;
+ return true;
}
- if ("Host".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ if (HeaderNames.From.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x4000000L) != 0)
{
- if ((_bits & 0x8000000L) != 0)
- {
- value = _headers._Host;
- return true;
- }
- return false;
+ value = _headers._From;
+ return true;
}
+ return false;
}
break;
- case 6:
+ }
+ case 5:
+ {
+ if (ReferenceEquals(HeaderNames.Allow, key))
{
- if ("Pragma".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x400L) != 0)
{
- if ((_bits & 0x10L) != 0)
- {
- value = _headers._Pragma;
- return true;
- }
- return false;
+ value = _headers._Allow;
+ return true;
}
- if ("Accept".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ if (ReferenceEquals(HeaderNames.Range, key))
+ {
+ if ((_bits & 0x1000000000L) != 0)
{
- if ((_bits & 0x80000L) != 0)
- {
- value = _headers._Accept;
- return true;
- }
- return false;
+ value = _headers._Range;
+ return true;
}
- if ("Cookie".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+
+ if (HeaderNames.Allow.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x400L) != 0)
{
- if ((_bits & 0x1000000L) != 0)
- {
- value = _headers._Cookie;
- return true;
- }
- return false;
+ value = _headers._Allow;
+ return true;
}
- if ("Expect".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ if (HeaderNames.Range.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x1000000000L) != 0)
{
- if ((_bits & 0x2000000L) != 0)
- {
- value = _headers._Expect;
- return true;
- }
- return false;
+ value = _headers._Range;
+ return true;
}
- if ("Origin".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ break;
+ }
+ case 6:
+ {
+ if (ReferenceEquals(HeaderNames.Accept, key))
+ {
+ if ((_bits & 0x80000L) != 0)
{
- if ((_bits & 0x40000000000L) != 0)
- {
- value = _headers._Origin;
- return true;
- }
- return false;
+ value = _headers._Accept;
+ return true;
}
+ return false;
}
- break;
- case 7:
+ if (ReferenceEquals(HeaderNames.Pragma, key))
{
- if ("Trailer".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x10L) != 0)
{
- if ((_bits & 0x20L) != 0)
- {
- value = _headers._Trailer;
- return true;
- }
- return false;
+ value = _headers._Pragma;
+ return true;
}
- if ("Upgrade".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ if (ReferenceEquals(HeaderNames.Cookie, key))
+ {
+ if ((_bits & 0x1000000L) != 0)
{
- if ((_bits & 0x80L) != 0)
- {
- value = _headers._Upgrade;
- return true;
- }
- return false;
+ value = _headers._Cookie;
+ return true;
}
- if ("Warning".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ if (ReferenceEquals(HeaderNames.Expect, key))
+ {
+ if ((_bits & 0x2000000L) != 0)
{
- if ((_bits & 0x200L) != 0)
- {
- value = _headers._Warning;
- return true;
- }
- return false;
+ value = _headers._Expect;
+ return true;
}
- if ("Expires".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ if (ReferenceEquals(HeaderNames.Origin, key))
+ {
+ if ((_bits & 0x400000000000L) != 0)
{
- if ((_bits & 0x20000L) != 0)
- {
- value = _headers._Expires;
- return true;
- }
- return false;
+ value = _headers._Origin;
+ return true;
}
- if ("Referer".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+
+ if (HeaderNames.Accept.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x80000L) != 0)
{
- if ((_bits & 0x800000000L) != 0)
- {
- value = _headers._Referer;
- return true;
- }
- return false;
+ value = _headers._Accept;
+ return true;
}
+ return false;
}
- break;
- case 17:
+ if (HeaderNames.Pragma.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ("Transfer-Encoding".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x10L) != 0)
{
- if ((_bits & 0x40L) != 0)
- {
- value = _headers._TransferEncoding;
- return true;
- }
- return false;
+ value = _headers._Pragma;
+ return true;
}
- if ("If-Modified-Since".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ if (HeaderNames.Cookie.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x1000000L) != 0)
{
- if ((_bits & 0x20000000L) != 0)
- {
- value = _headers._IfModifiedSince;
- return true;
- }
- return false;
+ value = _headers._Cookie;
+ return true;
}
+ return false;
}
- break;
- case 3:
+ if (HeaderNames.Expect.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ("Via".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x2000000L) != 0)
{
- if ((_bits & 0x100L) != 0)
- {
- value = _headers._Via;
- return true;
- }
- return false;
+ value = _headers._Expect;
+ return true;
}
- if ("DNT".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ if (HeaderNames.Origin.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x400000000000L) != 0)
{
- if ((_bits & 0x10000000000L) != 0)
- {
- value = _headers._DNT;
- return true;
- }
- return false;
+ value = _headers._Origin;
+ return true;
}
+ return false;
}
break;
- case 5:
+ }
+ case 7:
+ {
+ if (ReferenceEquals(HeaderNames.Trailer, key))
{
- if ("Allow".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x20L) != 0)
{
- if ((_bits & 0x400L) != 0)
- {
- value = _headers._Allow;
- return true;
- }
- return false;
+ value = _headers._Trailer;
+ return true;
}
- if ("Range".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ if (ReferenceEquals(HeaderNames.Upgrade, key))
+ {
+ if ((_bits & 0x80L) != 0)
{
- if ((_bits & 0x1000000000L) != 0)
- {
- value = _headers._Range;
- return true;
- }
- return false;
+ value = _headers._Upgrade;
+ return true;
}
+ return false;
}
- break;
- case 12:
+ if (ReferenceEquals(HeaderNames.Warning, key))
{
- if ("Content-Type".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x200L) != 0)
{
- if ((_bits & 0x800L) != 0)
- {
- value = _headers._ContentType;
- return true;
- }
- return false;
+ value = _headers._Warning;
+ return true;
}
- if ("Max-Forwards".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ if (ReferenceEquals(HeaderNames.Expires, key))
+ {
+ if ((_bits & 0x20000L) != 0)
{
- if ((_bits & 0x200000000L) != 0)
- {
- value = _headers._MaxForwards;
- return true;
- }
- return false;
+ value = _headers._Expires;
+ return true;
}
+ return false;
}
- break;
- case 16:
+ if (ReferenceEquals(HeaderNames.Referer, key))
{
- if ("Content-Encoding".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x800000000L) != 0)
{
- if ((_bits & 0x1000L) != 0)
- {
- value = _headers._ContentEncoding;
- return true;
- }
- return false;
+ value = _headers._Referer;
+ return true;
}
- if ("Content-Language".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+
+ if (HeaderNames.Trailer.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x20L) != 0)
{
- if ((_bits & 0x2000L) != 0)
- {
- value = _headers._ContentLanguage;
- return true;
- }
- return false;
+ value = _headers._Trailer;
+ return true;
}
- if ("Content-Location".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ if (HeaderNames.Upgrade.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x80L) != 0)
{
- if ((_bits & 0x4000L) != 0)
- {
- value = _headers._ContentLocation;
- return true;
- }
- return false;
+ value = _headers._Upgrade;
+ return true;
}
+ return false;
}
- break;
- case 11:
+ if (HeaderNames.Warning.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ("Content-MD5".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x200L) != 0)
{
- if ((_bits & 0x8000L) != 0)
- {
- value = _headers._ContentMD5;
- return true;
- }
- return false;
+ value = _headers._Warning;
+ return true;
}
+ return false;
}
- break;
- case 14:
+ if (HeaderNames.Expires.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ("Accept-Charset".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x20000L) != 0)
{
- if ((_bits & 0x100000L) != 0)
- {
- value = _headers._AcceptCharset;
- return true;
- }
- return false;
- }
- if ("Content-Length".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if (_contentLength.HasValue)
- {
- value = HeaderUtilities.FormatNonNegativeInt64(_contentLength.Value);
- return true;
- }
- return false;
+ value = _headers._Expires;
+ return true;
}
+ return false;
}
- break;
- case 15:
+ if (HeaderNames.Referer.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ("Accept-Encoding".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x200000L) != 0)
- {
- value = _headers._AcceptEncoding;
- return true;
- }
- return false;
- }
- if ("Accept-Language".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x800000000L) != 0)
{
- if ((_bits & 0x400000L) != 0)
- {
- value = _headers._AcceptLanguage;
- return true;
- }
- return false;
+ value = _headers._Referer;
+ return true;
}
+ return false;
}
break;
+ }
case 8:
+ {
+ if (ReferenceEquals(HeaderNames.IfMatch, key))
{
- if ("If-Match".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x10000000L) != 0)
- {
- value = _headers._IfMatch;
- return true;
- }
- return false;
- }
- if ("If-Range".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x10000000L) != 0)
{
- if ((_bits & 0x80000000L) != 0)
- {
- value = _headers._IfRange;
- return true;
- }
- return false;
+ value = _headers._IfMatch;
+ return true;
}
+ return false;
}
- break;
- case 19:
+ if (ReferenceEquals(HeaderNames.IfRange, key))
{
- if ("If-Unmodified-Since".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x80000000L) != 0)
{
- if ((_bits & 0x100000000L) != 0)
- {
- value = _headers._IfUnmodifiedSince;
- return true;
- }
- return false;
+ value = _headers._IfRange;
+ return true;
}
- if ("Proxy-Authorization".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+
+ if (HeaderNames.IfMatch.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x10000000L) != 0)
{
- if ((_bits & 0x400000000L) != 0)
- {
- value = _headers._ProxyAuthorization;
- return true;
- }
- return false;
+ value = _headers._IfMatch;
+ return true;
}
+ return false;
}
- break;
- case 2:
+ if (HeaderNames.IfRange.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ("TE".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x80000000L) != 0)
{
- if ((_bits & 0x2000000000L) != 0)
- {
- value = _headers._TE;
- return true;
- }
- return false;
+ value = _headers._IfRange;
+ return true;
}
+ return false;
}
break;
+ }
case 9:
+ {
+ if (ReferenceEquals(HeaderNames.Translate, key))
{
- if ("Translate".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x4000000000L) != 0)
{
- if ((_bits & 0x4000000000L) != 0)
- {
- value = _headers._Translate;
- return true;
- }
- return false;
+ value = _headers._Translate;
+ return true;
}
+ return false;
}
- break;
- case 25:
+
+ if (HeaderNames.Translate.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ("Upgrade-Insecure-Requests".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x4000000000L) != 0)
{
- if ((_bits & 0x20000000000L) != 0)
- {
- value = _headers._UpgradeInsecureRequests;
- return true;
- }
- return false;
+ value = _headers._Translate;
+ return true;
}
+ return false;
}
break;
- case 29:
+ }
+ case 10:
+ {
+ if (ReferenceEquals(HeaderNames.Connection, key))
{
- if ("Access-Control-Request-Method".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x2L) != 0)
{
- if ((_bits & 0x80000000000L) != 0)
- {
- value = _headers._AccessControlRequestMethod;
- return true;
- }
- return false;
+ value = _headers._Connection;
+ return true;
}
+ return false;
}
- break;
- case 30:
+ if (ReferenceEquals(HeaderNames.UserAgent, key))
{
- if ("Access-Control-Request-Headers".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x8000000000L) != 0)
{
- if ((_bits & 0x100000000000L) != 0)
- {
- value = _headers._AccessControlRequestHeaders;
- return true;
- }
- return false;
+ value = _headers._UserAgent;
+ return true;
}
+ return false;
}
- break;
- }
-
- return MaybeUnknown?.TryGetValue(key, out value) ?? false;
- }
-
- protected override void SetValueFast(string key, StringValues value)
- {
- switch (key.Length)
- {
- case 13:
+ if (ReferenceEquals(HeaderNames.KeepAlive, key))
{
- if ("Cache-Control".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x8L) != 0)
{
- _bits |= 0x1L;
- _headers._CacheControl = value;
- return;
+ value = _headers._KeepAlive;
+ return true;
}
- if ("Content-Range".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ if (ReferenceEquals(HeaderNames.RequestId, key))
+ {
+ if ((_bits & 0x40000000000L) != 0)
{
- _bits |= 0x10000L;
- _headers._ContentRange = value;
- return;
+ value = _headers._RequestId;
+ return true;
}
- if ("Last-Modified".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ if (ReferenceEquals(HeaderNames.TraceState, key))
+ {
+ if ((_bits & 0x200000000000L) != 0)
{
- _bits |= 0x40000L;
- _headers._LastModified = value;
- return;
+ value = _headers._TraceState;
+ return true;
}
- if ("Authorization".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+
+ if (HeaderNames.Connection.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x2L) != 0)
{
- _bits |= 0x800000L;
- _headers._Authorization = value;
- return;
+ value = _headers._Connection;
+ return true;
}
- if ("If-None-Match".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ if (HeaderNames.UserAgent.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x8000000000L) != 0)
{
- _bits |= 0x40000000L;
- _headers._IfNoneMatch = value;
- return;
+ value = _headers._UserAgent;
+ return true;
}
+ return false;
}
- break;
- case 10:
+ if (HeaderNames.KeepAlive.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ("Connection".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x8L) != 0)
{
- _bits |= 0x2L;
- _headers._Connection = value;
- return;
+ value = _headers._KeepAlive;
+ return true;
}
- if ("Keep-Alive".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ if (HeaderNames.RequestId.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x40000000000L) != 0)
{
- _bits |= 0x8L;
- _headers._KeepAlive = value;
- return;
+ value = _headers._RequestId;
+ return true;
}
- if ("User-Agent".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ if (HeaderNames.TraceState.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x200000000000L) != 0)
{
- _bits |= 0x8000000000L;
- _headers._UserAgent = value;
- return;
+ value = _headers._TraceState;
+ return true;
}
+ return false;
}
break;
- case 4:
+ }
+ case 11:
+ {
+ if (ReferenceEquals(HeaderNames.ContentMD5, key))
{
- if ("Date".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x8000L) != 0)
{
- _bits |= 0x4L;
- _headers._Date = value;
- return;
+ value = _headers._ContentMD5;
+ return true;
}
- if ("From".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ if (ReferenceEquals(HeaderNames.TraceParent, key))
+ {
+ if ((_bits & 0x100000000000L) != 0)
{
- _bits |= 0x4000000L;
- _headers._From = value;
- return;
+ value = _headers._TraceParent;
+ return true;
}
- if ("Host".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+
+ if (HeaderNames.ContentMD5.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x8000L) != 0)
{
- _bits |= 0x8000000L;
- _headers._Host = value;
- return;
+ value = _headers._ContentMD5;
+ return true;
}
+ return false;
}
- break;
- case 6:
+ if (HeaderNames.TraceParent.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ("Pragma".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x100000000000L) != 0)
{
- _bits |= 0x10L;
- _headers._Pragma = value;
- return;
+ value = _headers._TraceParent;
+ return true;
}
- if ("Accept".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ break;
+ }
+ case 12:
+ {
+ if (ReferenceEquals(HeaderNames.ContentType, key))
+ {
+ if ((_bits & 0x800L) != 0)
{
- _bits |= 0x80000L;
- _headers._Accept = value;
- return;
+ value = _headers._ContentType;
+ return true;
}
- if ("Cookie".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ if (ReferenceEquals(HeaderNames.MaxForwards, key))
+ {
+ if ((_bits & 0x200000000L) != 0)
{
- _bits |= 0x1000000L;
- _headers._Cookie = value;
- return;
+ value = _headers._MaxForwards;
+ return true;
}
- if ("Expect".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+
+ if (HeaderNames.ContentType.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x800L) != 0)
{
- _bits |= 0x2000000L;
- _headers._Expect = value;
- return;
+ value = _headers._ContentType;
+ return true;
}
- if ("Origin".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ if (HeaderNames.MaxForwards.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x200000000L) != 0)
{
- _bits |= 0x40000000000L;
- _headers._Origin = value;
- return;
+ value = _headers._MaxForwards;
+ return true;
}
+ return false;
}
break;
- case 7:
+ }
+ case 13:
+ {
+ if (ReferenceEquals(HeaderNames.CacheControl, key))
{
- if ("Trailer".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- _bits |= 0x20L;
- _headers._Trailer = value;
- return;
- }
- if ("Upgrade".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x1L) != 0)
{
- _bits |= 0x80L;
- _headers._Upgrade = value;
- return;
+ value = _headers._CacheControl;
+ return true;
}
- if ("Warning".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ if (ReferenceEquals(HeaderNames.ContentRange, key))
+ {
+ if ((_bits & 0x10000L) != 0)
{
- _bits |= 0x200L;
- _headers._Warning = value;
- return;
+ value = _headers._ContentRange;
+ return true;
}
- if ("Expires".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ if (ReferenceEquals(HeaderNames.LastModified, key))
+ {
+ if ((_bits & 0x40000L) != 0)
{
- _bits |= 0x20000L;
- _headers._Expires = value;
- return;
+ value = _headers._LastModified;
+ return true;
}
- if ("Referer".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ if (ReferenceEquals(HeaderNames.Authorization, key))
+ {
+ if ((_bits & 0x800000L) != 0)
{
- _bits |= 0x800000000L;
- _headers._Referer = value;
- return;
+ value = _headers._Authorization;
+ return true;
}
+ return false;
}
- break;
- case 17:
+ if (ReferenceEquals(HeaderNames.IfNoneMatch, key))
{
- if ("Transfer-Encoding".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x40000000L) != 0)
{
- _bits |= 0x40L;
- _headers._TransferEncoding = value;
- return;
+ value = _headers._IfNoneMatch;
+ return true;
}
- if ("If-Modified-Since".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+
+ if (HeaderNames.CacheControl.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x1L) != 0)
{
- _bits |= 0x20000000L;
- _headers._IfModifiedSince = value;
- return;
+ value = _headers._CacheControl;
+ return true;
}
+ return false;
}
- break;
- case 3:
+ if (HeaderNames.ContentRange.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ("Via".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x10000L) != 0)
{
- _bits |= 0x100L;
- _headers._Via = value;
- return;
+ value = _headers._ContentRange;
+ return true;
}
- if ("DNT".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ if (HeaderNames.LastModified.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x40000L) != 0)
{
- _bits |= 0x10000000000L;
- _headers._DNT = value;
- return;
+ value = _headers._LastModified;
+ return true;
}
+ return false;
}
- break;
- case 5:
+ if (HeaderNames.Authorization.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ("Allow".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x800000L) != 0)
{
- _bits |= 0x400L;
- _headers._Allow = value;
- return;
+ value = _headers._Authorization;
+ return true;
}
- if ("Range".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ if (HeaderNames.IfNoneMatch.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x40000000L) != 0)
{
- _bits |= 0x1000000000L;
- _headers._Range = value;
- return;
+ value = _headers._IfNoneMatch;
+ return true;
}
+ return false;
}
break;
- case 12:
+ }
+ case 14:
+ {
+ if (ReferenceEquals(HeaderNames.AcceptCharset, key))
{
- if ("Content-Type".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x100000L) != 0)
{
- _bits |= 0x800L;
- _headers._ContentType = value;
- return;
+ value = _headers._AcceptCharset;
+ return true;
}
- if ("Max-Forwards".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ if (ReferenceEquals(HeaderNames.ContentLength, key))
+ {
+ if (_contentLength.HasValue)
{
- _bits |= 0x200000000L;
- _headers._MaxForwards = value;
- return;
+ value = HeaderUtilities.FormatNonNegativeInt64(_contentLength.Value);
+ return true;
}
+ return false;
}
- break;
- case 16:
+
+ if (HeaderNames.AcceptCharset.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ("Content-Encoding".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- _bits |= 0x1000L;
- _headers._ContentEncoding = value;
- return;
- }
- if ("Content-Language".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x100000L) != 0)
{
- _bits |= 0x2000L;
- _headers._ContentLanguage = value;
- return;
- }
- if ("Content-Location".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- _bits |= 0x4000L;
- _headers._ContentLocation = value;
- return;
+ value = _headers._AcceptCharset;
+ return true;
}
+ return false;
}
- break;
- case 11:
+ if (HeaderNames.ContentLength.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ("Content-MD5".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if (_contentLength.HasValue)
{
- _bits |= 0x8000L;
- _headers._ContentMD5 = value;
- return;
+ value = HeaderUtilities.FormatNonNegativeInt64(_contentLength.Value);
+ return true;
}
+ return false;
}
break;
- case 14:
+ }
+ case 15:
+ {
+ if (ReferenceEquals(HeaderNames.AcceptEncoding, key))
{
- if ("Accept-Charset".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x200000L) != 0)
{
- _bits |= 0x100000L;
- _headers._AcceptCharset = value;
- return;
+ value = _headers._AcceptEncoding;
+ return true;
}
- if ("Content-Length".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ if (ReferenceEquals(HeaderNames.AcceptLanguage, key))
+ {
+ if ((_bits & 0x400000L) != 0)
{
- _contentLength = ParseContentLength(value.ToString());
- return;
+ value = _headers._AcceptLanguage;
+ return true;
}
+ return false;
}
- break;
- case 15:
+
+ if (HeaderNames.AcceptEncoding.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ("Accept-Encoding".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x200000L) != 0)
{
- _bits |= 0x200000L;
- _headers._AcceptEncoding = value;
- return;
+ value = _headers._AcceptEncoding;
+ return true;
}
- if ("Accept-Language".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ if (HeaderNames.AcceptLanguage.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x400000L) != 0)
{
- _bits |= 0x400000L;
- _headers._AcceptLanguage = value;
- return;
+ value = _headers._AcceptLanguage;
+ return true;
}
+ return false;
}
break;
- case 8:
+ }
+ case 16:
+ {
+ if (ReferenceEquals(HeaderNames.ContentEncoding, key))
{
- if ("If-Match".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- _bits |= 0x10000000L;
- _headers._IfMatch = value;
- return;
- }
- if ("If-Range".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x1000L) != 0)
{
- _bits |= 0x80000000L;
- _headers._IfRange = value;
- return;
+ value = _headers._ContentEncoding;
+ return true;
}
+ return false;
}
- break;
- case 19:
+ if (ReferenceEquals(HeaderNames.ContentLanguage, key))
{
- if ("If-Unmodified-Since".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x2000L) != 0)
{
- _bits |= 0x100000000L;
- _headers._IfUnmodifiedSince = value;
- return;
+ value = _headers._ContentLanguage;
+ return true;
}
- if ("Proxy-Authorization".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ if (ReferenceEquals(HeaderNames.ContentLocation, key))
+ {
+ if ((_bits & 0x4000L) != 0)
{
- _bits |= 0x400000000L;
- _headers._ProxyAuthorization = value;
- return;
+ value = _headers._ContentLocation;
+ return true;
}
+ return false;
}
- break;
- case 2:
+
+ if (HeaderNames.ContentEncoding.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ("TE".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x1000L) != 0)
{
- _bits |= 0x2000000000L;
- _headers._TE = value;
- return;
+ value = _headers._ContentEncoding;
+ return true;
}
+ return false;
}
- break;
- case 9:
+ if (HeaderNames.ContentLanguage.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ("Translate".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x2000L) != 0)
{
- _bits |= 0x4000000000L;
- _headers._Translate = value;
- return;
+ value = _headers._ContentLanguage;
+ return true;
}
+ return false;
}
- break;
- case 25:
+ if (HeaderNames.ContentLocation.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ("Upgrade-Insecure-Requests".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x4000L) != 0)
{
- _bits |= 0x20000000000L;
- _headers._UpgradeInsecureRequests = value;
- return;
+ value = _headers._ContentLocation;
+ return true;
}
+ return false;
}
break;
- case 29:
+ }
+ case 17:
+ {
+ if (ReferenceEquals(HeaderNames.TransferEncoding, key))
{
- if ("Access-Control-Request-Method".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x40L) != 0)
{
- _bits |= 0x80000000000L;
- _headers._AccessControlRequestMethod = value;
- return;
+ value = _headers._TransferEncoding;
+ return true;
}
+ return false;
}
- break;
- case 30:
+ if (ReferenceEquals(HeaderNames.IfModifiedSince, key))
{
- if ("Access-Control-Request-Headers".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x20000000L) != 0)
{
- _bits |= 0x100000000000L;
- _headers._AccessControlRequestHeaders = value;
- return;
+ value = _headers._IfModifiedSince;
+ return true;
}
+ return false;
}
- break;
- }
- SetValueUnknown(key, value);
- }
-
- protected override bool AddValueFast(string key, StringValues value)
- {
- switch (key.Length)
- {
- case 13:
+ if (HeaderNames.TransferEncoding.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ("Cache-Control".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x1L) == 0)
- {
- _bits |= 0x1L;
- _headers._CacheControl = value;
- return true;
- }
- return false;
- }
- if ("Content-Range".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x10000L) == 0)
- {
- _bits |= 0x10000L;
- _headers._ContentRange = value;
- return true;
- }
- return false;
- }
- if ("Last-Modified".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x40000L) == 0)
- {
- _bits |= 0x40000L;
- _headers._LastModified = value;
- return true;
- }
- return false;
- }
- if ("Authorization".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x40L) != 0)
{
- if ((_bits & 0x800000L) == 0)
- {
- _bits |= 0x800000L;
- _headers._Authorization = value;
- return true;
- }
- return false;
- }
- if ("If-None-Match".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x40000000L) == 0)
- {
- _bits |= 0x40000000L;
- _headers._IfNoneMatch = value;
- return true;
- }
- return false;
+ value = _headers._TransferEncoding;
+ return true;
}
+ return false;
}
- break;
- case 10:
+ if (HeaderNames.IfModifiedSince.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ("Connection".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x2L) == 0)
- {
- _bits |= 0x2L;
- _headers._Connection = value;
- return true;
- }
- return false;
- }
- if ("Keep-Alive".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x8L) == 0)
- {
- _bits |= 0x8L;
- _headers._KeepAlive = value;
- return true;
- }
- return false;
- }
- if ("User-Agent".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x20000000L) != 0)
{
- if ((_bits & 0x8000000000L) == 0)
- {
- _bits |= 0x8000000000L;
- _headers._UserAgent = value;
- return true;
- }
- return false;
+ value = _headers._IfModifiedSince;
+ return true;
}
+ return false;
}
break;
- case 4:
+ }
+ case 19:
+ {
+ if (ReferenceEquals(HeaderNames.IfUnmodifiedSince, key))
{
- if ("Date".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x4L) == 0)
- {
- _bits |= 0x4L;
- _headers._Date = value;
- return true;
- }
- return false;
- }
- if ("From".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x4000000L) == 0)
- {
- _bits |= 0x4000000L;
- _headers._From = value;
- return true;
- }
- return false;
- }
- if ("Host".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x100000000L) != 0)
{
- if ((_bits & 0x8000000L) == 0)
- {
- _bits |= 0x8000000L;
- _headers._Host = value;
- return true;
- }
- return false;
+ value = _headers._IfUnmodifiedSince;
+ return true;
}
+ return false;
}
- break;
- case 6:
+ if (ReferenceEquals(HeaderNames.ProxyAuthorization, key))
{
- if ("Pragma".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x10L) == 0)
- {
- _bits |= 0x10L;
- _headers._Pragma = value;
- return true;
- }
- return false;
- }
- if ("Accept".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x80000L) == 0)
- {
- _bits |= 0x80000L;
- _headers._Accept = value;
- return true;
- }
- return false;
- }
- if ("Cookie".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x1000000L) == 0)
- {
- _bits |= 0x1000000L;
- _headers._Cookie = value;
- return true;
- }
- return false;
- }
- if ("Expect".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x2000000L) == 0)
- {
- _bits |= 0x2000000L;
- _headers._Expect = value;
- return true;
- }
- return false;
- }
- if ("Origin".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x400000000L) != 0)
{
- if ((_bits & 0x40000000000L) == 0)
- {
- _bits |= 0x40000000000L;
- _headers._Origin = value;
- return true;
- }
- return false;
+ value = _headers._ProxyAuthorization;
+ return true;
}
+ return false;
}
- break;
- case 7:
+ if (ReferenceEquals(HeaderNames.CorrelationContext, key))
{
- if ("Trailer".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x20L) == 0)
- {
- _bits |= 0x20L;
- _headers._Trailer = value;
- return true;
- }
- return false;
- }
- if ("Upgrade".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x80L) == 0)
- {
- _bits |= 0x80L;
- _headers._Upgrade = value;
- return true;
- }
- return false;
- }
- if ("Warning".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x200L) == 0)
- {
- _bits |= 0x200L;
- _headers._Warning = value;
- return true;
- }
- return false;
- }
- if ("Expires".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x80000000000L) != 0)
{
- if ((_bits & 0x20000L) == 0)
- {
- _bits |= 0x20000L;
- _headers._Expires = value;
- return true;
- }
- return false;
+ value = _headers._CorrelationContext;
+ return true;
}
- if ("Referer".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+
+ if (HeaderNames.IfUnmodifiedSince.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x100000000L) != 0)
{
- if ((_bits & 0x800000000L) == 0)
- {
- _bits |= 0x800000000L;
- _headers._Referer = value;
- return true;
- }
- return false;
+ value = _headers._IfUnmodifiedSince;
+ return true;
}
+ return false;
}
- break;
- case 17:
+ if (HeaderNames.ProxyAuthorization.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ("Transfer-Encoding".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x400000000L) != 0)
{
- if ((_bits & 0x40L) == 0)
- {
- _bits |= 0x40L;
- _headers._TransferEncoding = value;
- return true;
- }
- return false;
+ value = _headers._ProxyAuthorization;
+ return true;
}
- if ("If-Modified-Since".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+ if (HeaderNames.CorrelationContext.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x80000000000L) != 0)
{
- if ((_bits & 0x20000000L) == 0)
- {
- _bits |= 0x20000000L;
- _headers._IfModifiedSince = value;
- return true;
- }
- return false;
+ value = _headers._CorrelationContext;
+ return true;
}
+ return false;
}
break;
- case 3:
+ }
+ case 25:
+ {
+ if (ReferenceEquals(HeaderNames.UpgradeInsecureRequests, key))
{
- if ("Via".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x20000000000L) != 0)
{
- if ((_bits & 0x100L) == 0)
- {
- _bits |= 0x100L;
- _headers._Via = value;
- return true;
- }
- return false;
+ value = _headers._UpgradeInsecureRequests;
+ return true;
}
- if ("DNT".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+
+ if (HeaderNames.UpgradeInsecureRequests.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x20000000000L) != 0)
{
- if ((_bits & 0x10000000000L) == 0)
- {
- _bits |= 0x10000000000L;
- _headers._DNT = value;
- return true;
- }
- return false;
+ value = _headers._UpgradeInsecureRequests;
+ return true;
}
+ return false;
}
break;
- case 5:
+ }
+ case 29:
+ {
+ if (ReferenceEquals(HeaderNames.AccessControlRequestMethod, key))
{
- if ("Allow".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x800000000000L) != 0)
{
- if ((_bits & 0x400L) == 0)
- {
- _bits |= 0x400L;
- _headers._Allow = value;
- return true;
- }
- return false;
+ value = _headers._AccessControlRequestMethod;
+ return true;
}
- if ("Range".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+
+ if (HeaderNames.AccessControlRequestMethod.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x800000000000L) != 0)
{
- if ((_bits & 0x1000000000L) == 0)
- {
- _bits |= 0x1000000000L;
- _headers._Range = value;
- return true;
- }
- return false;
+ value = _headers._AccessControlRequestMethod;
+ return true;
}
+ return false;
}
break;
- case 12:
+ }
+ case 30:
+ {
+ if (ReferenceEquals(HeaderNames.AccessControlRequestHeaders, key))
{
- if ("Content-Type".Equals(key, StringComparison.OrdinalIgnoreCase))
+ if ((_bits & 0x1000000000000L) != 0)
{
- if ((_bits & 0x800L) == 0)
- {
- _bits |= 0x800L;
- _headers._ContentType = value;
- return true;
- }
- return false;
+ value = _headers._AccessControlRequestHeaders;
+ return true;
}
- if ("Max-Forwards".Equals(key, StringComparison.OrdinalIgnoreCase))
+ return false;
+ }
+
+ if (HeaderNames.AccessControlRequestHeaders.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x1000000000000L) != 0)
{
- if ((_bits & 0x200000000L) == 0)
- {
- _bits |= 0x200000000L;
- _headers._MaxForwards = value;
- return true;
- }
- return false;
+ value = _headers._AccessControlRequestHeaders;
+ return true;
}
+ return false;
}
break;
- case 16:
+ }
+ }
+
+ return TryGetUnknown(key, ref value);
+ }
+
+ protected override void SetValueFast(string key, StringValues value)
+ {
+ switch (key.Length)
+ {
+ case 2:
+ {
+ if (ReferenceEquals(HeaderNames.TE, key))
{
- if ("Content-Encoding".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x1000L) == 0)
- {
- _bits |= 0x1000L;
- _headers._ContentEncoding = value;
- return true;
- }
- return false;
- }
- if ("Content-Language".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x2000L) == 0)
- {
- _bits |= 0x2000L;
- _headers._ContentLanguage = value;
- return true;
- }
- return false;
- }
- if ("Content-Location".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x4000L) == 0)
- {
- _bits |= 0x4000L;
- _headers._ContentLocation = value;
- return true;
- }
- return false;
- }
+ _bits |= 0x2000000000L;
+ _headers._TE = value;
+ return;
}
- break;
- case 11:
+
+ if (HeaderNames.TE.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ("Content-MD5".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x8000L) == 0)
- {
- _bits |= 0x8000L;
- _headers._ContentMD5 = value;
- return true;
- }
- return false;
- }
+ _bits |= 0x2000000000L;
+ _headers._TE = value;
+ return;
}
break;
- case 14:
+ }
+ case 3:
+ {
+ if (ReferenceEquals(HeaderNames.Via, key))
{
- if ("Accept-Charset".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x100000L) == 0)
- {
- _bits |= 0x100000L;
- _headers._AcceptCharset = value;
- return true;
- }
- return false;
- }
- if ("Content-Length".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if (!_contentLength.HasValue)
- {
- _contentLength = ParseContentLength(value);
- return true;
- }
- return false;
- }
+ _bits |= 0x100L;
+ _headers._Via = value;
+ return;
}
- break;
- case 15:
+ if (ReferenceEquals(HeaderNames.DNT, key))
{
- if ("Accept-Encoding".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x200000L) == 0)
- {
- _bits |= 0x200000L;
- _headers._AcceptEncoding = value;
- return true;
- }
- return false;
- }
- if ("Accept-Language".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x400000L) == 0)
- {
- _bits |= 0x400000L;
- _headers._AcceptLanguage = value;
- return true;
- }
- return false;
- }
+ _bits |= 0x10000000000L;
+ _headers._DNT = value;
+ return;
}
- break;
- case 8:
+
+ if (HeaderNames.Via.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ("If-Match".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x10000000L) == 0)
- {
- _bits |= 0x10000000L;
- _headers._IfMatch = value;
- return true;
- }
- return false;
- }
- if ("If-Range".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x80000000L) == 0)
- {
- _bits |= 0x80000000L;
- _headers._IfRange = value;
- return true;
- }
- return false;
- }
+ _bits |= 0x100L;
+ _headers._Via = value;
+ return;
}
- break;
- case 19:
+ if (HeaderNames.DNT.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ("If-Unmodified-Since".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x100000000L) == 0)
- {
- _bits |= 0x100000000L;
- _headers._IfUnmodifiedSince = value;
- return true;
- }
- return false;
- }
- if ("Proxy-Authorization".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x400000000L) == 0)
- {
- _bits |= 0x400000000L;
- _headers._ProxyAuthorization = value;
- return true;
- }
- return false;
- }
+ _bits |= 0x10000000000L;
+ _headers._DNT = value;
+ return;
}
break;
- case 2:
+ }
+ case 4:
+ {
+ if (ReferenceEquals(HeaderNames.Host, key))
{
- if ("TE".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x2000000000L) == 0)
- {
- _bits |= 0x2000000000L;
- _headers._TE = value;
- return true;
- }
- return false;
- }
+ _bits |= 0x8000000L;
+ _headers._Host = value;
+ return;
}
- break;
- case 9:
+ if (ReferenceEquals(HeaderNames.Date, key))
{
- if ("Translate".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x4000000000L) == 0)
- {
- _bits |= 0x4000000000L;
- _headers._Translate = value;
- return true;
- }
- return false;
- }
+ _bits |= 0x4L;
+ _headers._Date = value;
+ return;
}
- break;
- case 25:
+ if (ReferenceEquals(HeaderNames.From, key))
{
- if ("Upgrade-Insecure-Requests".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x20000000000L) == 0)
- {
- _bits |= 0x20000000000L;
- _headers._UpgradeInsecureRequests = value;
- return true;
- }
- return false;
- }
+ _bits |= 0x4000000L;
+ _headers._From = value;
+ return;
}
- break;
- case 29:
+
+ if (HeaderNames.Host.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ("Access-Control-Request-Method".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x80000000000L) == 0)
- {
- _bits |= 0x80000000000L;
- _headers._AccessControlRequestMethod = value;
- return true;
- }
- return false;
- }
+ _bits |= 0x8000000L;
+ _headers._Host = value;
+ return;
}
- break;
- case 30:
+ if (HeaderNames.Date.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ("Access-Control-Request-Headers".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x100000000000L) == 0)
- {
- _bits |= 0x100000000000L;
- _headers._AccessControlRequestHeaders = value;
- return true;
- }
- return false;
- }
+ _bits |= 0x4L;
+ _headers._Date = value;
+ return;
}
- break;
- }
-
- Unknown.Add(key, value);
- // Return true, above will throw and exit for false
- return true;
- }
-
- protected override bool RemoveFast(string key)
- {
- switch (key.Length)
- {
- case 13:
+ if (HeaderNames.From.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ("Cache-Control".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x1L) != 0)
- {
- _bits &= ~0x1L;
- _headers._CacheControl = default(StringValues);
- return true;
- }
- return false;
- }
- if ("Content-Range".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x10000L) != 0)
- {
- _bits &= ~0x10000L;
- _headers._ContentRange = default(StringValues);
- return true;
- }
- return false;
- }
- if ("Last-Modified".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x40000L) != 0)
- {
- _bits &= ~0x40000L;
- _headers._LastModified = default(StringValues);
- return true;
- }
- return false;
- }
- if ("Authorization".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x800000L) != 0)
- {
- _bits &= ~0x800000L;
- _headers._Authorization = default(StringValues);
- return true;
- }
- return false;
- }
- if ("If-None-Match".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x40000000L) != 0)
- {
- _bits &= ~0x40000000L;
- _headers._IfNoneMatch = default(StringValues);
- return true;
- }
- return false;
- }
+ _bits |= 0x4000000L;
+ _headers._From = value;
+ return;
}
break;
- case 10:
+ }
+ case 5:
+ {
+ if (ReferenceEquals(HeaderNames.Allow, key))
{
- if ("Connection".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x2L) != 0)
- {
- _bits &= ~0x2L;
- _headers._Connection = default(StringValues);
- return true;
- }
- return false;
- }
- if ("Keep-Alive".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x8L) != 0)
- {
- _bits &= ~0x8L;
- _headers._KeepAlive = default(StringValues);
- return true;
- }
- return false;
- }
- if ("User-Agent".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x8000000000L) != 0)
- {
- _bits &= ~0x8000000000L;
- _headers._UserAgent = default(StringValues);
- return true;
- }
- return false;
- }
+ _bits |= 0x400L;
+ _headers._Allow = value;
+ return;
}
- break;
- case 4:
+ if (ReferenceEquals(HeaderNames.Range, key))
{
- if ("Date".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x4L) != 0)
- {
- _bits &= ~0x4L;
- _headers._Date = default(StringValues);
- return true;
- }
- return false;
- }
- if ("From".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x4000000L) != 0)
- {
- _bits &= ~0x4000000L;
- _headers._From = default(StringValues);
- return true;
- }
- return false;
- }
- if ("Host".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x8000000L) != 0)
- {
- _bits &= ~0x8000000L;
- _headers._Host = default(StringValues);
- return true;
- }
- return false;
- }
+ _bits |= 0x1000000000L;
+ _headers._Range = value;
+ return;
}
- break;
- case 6:
+
+ if (HeaderNames.Allow.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ("Pragma".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x10L) != 0)
- {
- _bits &= ~0x10L;
- _headers._Pragma = default(StringValues);
- return true;
- }
- return false;
- }
- if ("Accept".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x80000L) != 0)
- {
- _bits &= ~0x80000L;
- _headers._Accept = default(StringValues);
- return true;
- }
- return false;
- }
- if ("Cookie".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x1000000L) != 0)
- {
- _bits &= ~0x1000000L;
- _headers._Cookie = default(StringValues);
- return true;
- }
- return false;
- }
- if ("Expect".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x2000000L) != 0)
- {
- _bits &= ~0x2000000L;
- _headers._Expect = default(StringValues);
- return true;
- }
- return false;
- }
- if ("Origin".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x40000000000L) != 0)
- {
- _bits &= ~0x40000000000L;
- _headers._Origin = default(StringValues);
- return true;
- }
- return false;
- }
+ _bits |= 0x400L;
+ _headers._Allow = value;
+ return;
}
- break;
- case 7:
+ if (HeaderNames.Range.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ("Trailer".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x20L) != 0)
- {
- _bits &= ~0x20L;
- _headers._Trailer = default(StringValues);
- return true;
- }
- return false;
- }
- if ("Upgrade".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x80L) != 0)
- {
- _bits &= ~0x80L;
- _headers._Upgrade = default(StringValues);
- return true;
- }
- return false;
- }
- if ("Warning".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x200L) != 0)
- {
- _bits &= ~0x200L;
- _headers._Warning = default(StringValues);
- return true;
- }
- return false;
- }
- if ("Expires".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x20000L) != 0)
- {
- _bits &= ~0x20000L;
- _headers._Expires = default(StringValues);
- return true;
- }
- return false;
- }
- if ("Referer".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x800000000L) != 0)
- {
- _bits &= ~0x800000000L;
- _headers._Referer = default(StringValues);
- return true;
- }
- return false;
- }
+ _bits |= 0x1000000000L;
+ _headers._Range = value;
+ return;
}
break;
- case 17:
+ }
+ case 6:
+ {
+ if (ReferenceEquals(HeaderNames.Accept, key))
{
- if ("Transfer-Encoding".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x40L) != 0)
- {
- _bits &= ~0x40L;
- _headers._TransferEncoding = default(StringValues);
- return true;
- }
- return false;
- }
- if ("If-Modified-Since".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x20000000L) != 0)
- {
- _bits &= ~0x20000000L;
- _headers._IfModifiedSince = default(StringValues);
- return true;
- }
- return false;
- }
+ _bits |= 0x80000L;
+ _headers._Accept = value;
+ return;
}
- break;
- case 3:
+ if (ReferenceEquals(HeaderNames.Pragma, key))
{
- if ("Via".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x100L) != 0)
- {
- _bits &= ~0x100L;
- _headers._Via = default(StringValues);
- return true;
- }
- return false;
- }
- if ("DNT".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x10000000000L) != 0)
- {
- _bits &= ~0x10000000000L;
- _headers._DNT = default(StringValues);
- return true;
- }
- return false;
- }
+ _bits |= 0x10L;
+ _headers._Pragma = value;
+ return;
}
- break;
- case 5:
+ if (ReferenceEquals(HeaderNames.Cookie, key))
{
- if ("Allow".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x400L) != 0)
- {
- _bits &= ~0x400L;
- _headers._Allow = default(StringValues);
- return true;
- }
- return false;
- }
- if ("Range".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x1000000000L) != 0)
- {
- _bits &= ~0x1000000000L;
- _headers._Range = default(StringValues);
- return true;
- }
- return false;
- }
+ _bits |= 0x1000000L;
+ _headers._Cookie = value;
+ return;
}
- break;
- case 12:
+ if (ReferenceEquals(HeaderNames.Expect, key))
{
- if ("Content-Type".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x800L) != 0)
- {
- _bits &= ~0x800L;
- _headers._ContentType = default(StringValues);
- return true;
- }
- return false;
- }
- if ("Max-Forwards".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x200000000L) != 0)
- {
- _bits &= ~0x200000000L;
- _headers._MaxForwards = default(StringValues);
- return true;
- }
- return false;
- }
+ _bits |= 0x2000000L;
+ _headers._Expect = value;
+ return;
}
- break;
- case 16:
+ if (ReferenceEquals(HeaderNames.Origin, key))
{
- if ("Content-Encoding".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x1000L) != 0)
- {
- _bits &= ~0x1000L;
- _headers._ContentEncoding = default(StringValues);
- return true;
- }
- return false;
- }
- if ("Content-Language".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x2000L) != 0)
- {
- _bits &= ~0x2000L;
- _headers._ContentLanguage = default(StringValues);
- return true;
- }
- return false;
- }
- if ("Content-Location".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x4000L) != 0)
- {
- _bits &= ~0x4000L;
- _headers._ContentLocation = default(StringValues);
- return true;
- }
- return false;
- }
+ _bits |= 0x400000000000L;
+ _headers._Origin = value;
+ return;
}
- break;
- case 11:
+
+ if (HeaderNames.Accept.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ("Content-MD5".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x8000L) != 0)
- {
- _bits &= ~0x8000L;
- _headers._ContentMD5 = default(StringValues);
- return true;
- }
- return false;
- }
+ _bits |= 0x80000L;
+ _headers._Accept = value;
+ return;
}
- break;
- case 14:
+ if (HeaderNames.Pragma.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ("Accept-Charset".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x100000L) != 0)
- {
- _bits &= ~0x100000L;
- _headers._AcceptCharset = default(StringValues);
- return true;
- }
- return false;
- }
- if ("Content-Length".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if (_contentLength.HasValue)
- {
- _contentLength = null;
- return true;
- }
- return false;
- }
+ _bits |= 0x10L;
+ _headers._Pragma = value;
+ return;
+ }
+ if (HeaderNames.Cookie.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x1000000L;
+ _headers._Cookie = value;
+ return;
+ }
+ if (HeaderNames.Expect.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x2000000L;
+ _headers._Expect = value;
+ return;
+ }
+ if (HeaderNames.Origin.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x400000000000L;
+ _headers._Origin = value;
+ return;
}
break;
- case 15:
+ }
+ case 7:
+ {
+ if (ReferenceEquals(HeaderNames.Trailer, key))
{
- if ("Accept-Encoding".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x200000L) != 0)
- {
- _bits &= ~0x200000L;
- _headers._AcceptEncoding = default(StringValues);
- return true;
- }
- return false;
- }
- if ("Accept-Language".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x400000L) != 0)
- {
- _bits &= ~0x400000L;
- _headers._AcceptLanguage = default(StringValues);
- return true;
- }
- return false;
- }
+ _bits |= 0x20L;
+ _headers._Trailer = value;
+ return;
+ }
+ if (ReferenceEquals(HeaderNames.Upgrade, key))
+ {
+ _bits |= 0x80L;
+ _headers._Upgrade = value;
+ return;
+ }
+ if (ReferenceEquals(HeaderNames.Warning, key))
+ {
+ _bits |= 0x200L;
+ _headers._Warning = value;
+ return;
+ }
+ if (ReferenceEquals(HeaderNames.Expires, key))
+ {
+ _bits |= 0x20000L;
+ _headers._Expires = value;
+ return;
+ }
+ if (ReferenceEquals(HeaderNames.Referer, key))
+ {
+ _bits |= 0x800000000L;
+ _headers._Referer = value;
+ return;
+ }
+
+ if (HeaderNames.Trailer.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x20L;
+ _headers._Trailer = value;
+ return;
+ }
+ if (HeaderNames.Upgrade.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x80L;
+ _headers._Upgrade = value;
+ return;
+ }
+ if (HeaderNames.Warning.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x200L;
+ _headers._Warning = value;
+ return;
+ }
+ if (HeaderNames.Expires.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x20000L;
+ _headers._Expires = value;
+ return;
+ }
+ if (HeaderNames.Referer.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x800000000L;
+ _headers._Referer = value;
+ return;
}
break;
+ }
case 8:
+ {
+ if (ReferenceEquals(HeaderNames.IfMatch, key))
{
- if ("If-Match".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x10000000L) != 0)
- {
- _bits &= ~0x10000000L;
- _headers._IfMatch = default(StringValues);
- return true;
- }
- return false;
- }
- if ("If-Range".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x80000000L) != 0)
- {
- _bits &= ~0x80000000L;
- _headers._IfRange = default(StringValues);
- return true;
- }
- return false;
- }
+ _bits |= 0x10000000L;
+ _headers._IfMatch = value;
+ return;
}
- break;
- case 19:
+ if (ReferenceEquals(HeaderNames.IfRange, key))
{
- if ("If-Unmodified-Since".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x100000000L) != 0)
- {
- _bits &= ~0x100000000L;
- _headers._IfUnmodifiedSince = default(StringValues);
- return true;
- }
- return false;
- }
- if ("Proxy-Authorization".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x400000000L) != 0)
- {
- _bits &= ~0x400000000L;
- _headers._ProxyAuthorization = default(StringValues);
- return true;
- }
- return false;
- }
+ _bits |= 0x80000000L;
+ _headers._IfRange = value;
+ return;
}
- break;
- case 2:
+
+ if (HeaderNames.IfMatch.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ("TE".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x2000000000L) != 0)
- {
- _bits &= ~0x2000000000L;
- _headers._TE = default(StringValues);
- return true;
- }
- return false;
- }
+ _bits |= 0x10000000L;
+ _headers._IfMatch = value;
+ return;
+ }
+ if (HeaderNames.IfRange.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x80000000L;
+ _headers._IfRange = value;
+ return;
}
break;
+ }
case 9:
+ {
+ if (ReferenceEquals(HeaderNames.Translate, key))
{
- if ("Translate".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x4000000000L) != 0)
- {
- _bits &= ~0x4000000000L;
- _headers._Translate = default(StringValues);
- return true;
- }
- return false;
- }
+ _bits |= 0x4000000000L;
+ _headers._Translate = value;
+ return;
}
- break;
- case 25:
+
+ if (HeaderNames.Translate.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ("Upgrade-Insecure-Requests".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x20000000000L) != 0)
- {
- _bits &= ~0x20000000000L;
- _headers._UpgradeInsecureRequests = default(StringValues);
- return true;
- }
- return false;
- }
+ _bits |= 0x4000000000L;
+ _headers._Translate = value;
+ return;
}
break;
- case 29:
+ }
+ case 10:
+ {
+ if (ReferenceEquals(HeaderNames.Connection, key))
{
- if ("Access-Control-Request-Method".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x80000000000L) != 0)
- {
- _bits &= ~0x80000000000L;
- _headers._AccessControlRequestMethod = default(StringValues);
- return true;
- }
- return false;
- }
+ _bits |= 0x2L;
+ _headers._Connection = value;
+ return;
}
- break;
- case 30:
+ if (ReferenceEquals(HeaderNames.UserAgent, key))
{
- if ("Access-Control-Request-Headers".Equals(key, StringComparison.OrdinalIgnoreCase))
- {
- if ((_bits & 0x100000000000L) != 0)
- {
- _bits &= ~0x100000000000L;
- _headers._AccessControlRequestHeaders = default(StringValues);
- return true;
- }
- return false;
- }
+ _bits |= 0x8000000000L;
+ _headers._UserAgent = value;
+ return;
+ }
+ if (ReferenceEquals(HeaderNames.KeepAlive, key))
+ {
+ _bits |= 0x8L;
+ _headers._KeepAlive = value;
+ return;
+ }
+ if (ReferenceEquals(HeaderNames.RequestId, key))
+ {
+ _bits |= 0x40000000000L;
+ _headers._RequestId = value;
+ return;
+ }
+ if (ReferenceEquals(HeaderNames.TraceState, key))
+ {
+ _bits |= 0x200000000000L;
+ _headers._TraceState = value;
+ return;
}
- break;
- }
- return MaybeUnknown?.Remove(key) ?? false;
- }
- private void Clear(long bitsToClear)
- {
- var tempBits = bitsToClear;
-
- if ((tempBits & 0x2L) != 0)
- {
- _headers._Connection = default(StringValues);
- if((tempBits & ~0x2L) == 0)
- {
- return;
+ if (HeaderNames.Connection.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x2L;
+ _headers._Connection = value;
+ return;
+ }
+ if (HeaderNames.UserAgent.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x8000000000L;
+ _headers._UserAgent = value;
+ return;
+ }
+ if (HeaderNames.KeepAlive.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x8L;
+ _headers._KeepAlive = value;
+ return;
+ }
+ if (HeaderNames.RequestId.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x40000000000L;
+ _headers._RequestId = value;
+ return;
+ }
+ if (HeaderNames.TraceState.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x200000000000L;
+ _headers._TraceState = value;
+ return;
+ }
+ break;
}
- tempBits &= ~0x2L;
- }
-
- if ((tempBits & 0x80000L) != 0)
- {
- _headers._Accept = default(StringValues);
- if((tempBits & ~0x80000L) == 0)
+ case 11:
{
- return;
+ if (ReferenceEquals(HeaderNames.ContentMD5, key))
+ {
+ _bits |= 0x8000L;
+ _headers._ContentMD5 = value;
+ return;
+ }
+ if (ReferenceEquals(HeaderNames.TraceParent, key))
+ {
+ _bits |= 0x100000000000L;
+ _headers._TraceParent = value;
+ return;
+ }
+
+ if (HeaderNames.ContentMD5.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x8000L;
+ _headers._ContentMD5 = value;
+ return;
+ }
+ if (HeaderNames.TraceParent.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x100000000000L;
+ _headers._TraceParent = value;
+ return;
+ }
+ break;
}
- tempBits &= ~0x80000L;
- }
-
- if ((tempBits & 0x8000000L) != 0)
- {
- _headers._Host = default(StringValues);
- if((tempBits & ~0x8000000L) == 0)
+ case 12:
{
- return;
+ if (ReferenceEquals(HeaderNames.ContentType, key))
+ {
+ _bits |= 0x800L;
+ _headers._ContentType = value;
+ return;
+ }
+ if (ReferenceEquals(HeaderNames.MaxForwards, key))
+ {
+ _bits |= 0x200000000L;
+ _headers._MaxForwards = value;
+ return;
+ }
+
+ if (HeaderNames.ContentType.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x800L;
+ _headers._ContentType = value;
+ return;
+ }
+ if (HeaderNames.MaxForwards.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x200000000L;
+ _headers._MaxForwards = value;
+ return;
+ }
+ break;
}
- tempBits &= ~0x8000000L;
- }
-
- if ((tempBits & 0x8000000000L) != 0)
- {
- _headers._UserAgent = default(StringValues);
- if((tempBits & ~0x8000000000L) == 0)
+ case 13:
{
- return;
- }
- tempBits &= ~0x8000000000L;
- }
-
- if ((tempBits & 0x1L) != 0)
- {
- _headers._CacheControl = default(StringValues);
- if((tempBits & ~0x1L) == 0)
- {
- return;
- }
- tempBits &= ~0x1L;
- }
-
- if ((tempBits & 0x4L) != 0)
- {
- _headers._Date = default(StringValues);
- if((tempBits & ~0x4L) == 0)
- {
- return;
+ if (ReferenceEquals(HeaderNames.CacheControl, key))
+ {
+ _bits |= 0x1L;
+ _headers._CacheControl = value;
+ return;
+ }
+ if (ReferenceEquals(HeaderNames.ContentRange, key))
+ {
+ _bits |= 0x10000L;
+ _headers._ContentRange = value;
+ return;
+ }
+ if (ReferenceEquals(HeaderNames.LastModified, key))
+ {
+ _bits |= 0x40000L;
+ _headers._LastModified = value;
+ return;
+ }
+ if (ReferenceEquals(HeaderNames.Authorization, key))
+ {
+ _bits |= 0x800000L;
+ _headers._Authorization = value;
+ return;
+ }
+ if (ReferenceEquals(HeaderNames.IfNoneMatch, key))
+ {
+ _bits |= 0x40000000L;
+ _headers._IfNoneMatch = value;
+ return;
+ }
+
+ if (HeaderNames.CacheControl.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x1L;
+ _headers._CacheControl = value;
+ return;
+ }
+ if (HeaderNames.ContentRange.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x10000L;
+ _headers._ContentRange = value;
+ return;
+ }
+ if (HeaderNames.LastModified.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x40000L;
+ _headers._LastModified = value;
+ return;
+ }
+ if (HeaderNames.Authorization.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x800000L;
+ _headers._Authorization = value;
+ return;
+ }
+ if (HeaderNames.IfNoneMatch.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x40000000L;
+ _headers._IfNoneMatch = value;
+ return;
+ }
+ break;
}
- tempBits &= ~0x4L;
- }
-
- if ((tempBits & 0x8L) != 0)
- {
- _headers._KeepAlive = default(StringValues);
- if((tempBits & ~0x8L) == 0)
+ case 14:
{
- return;
+ if (ReferenceEquals(HeaderNames.AcceptCharset, key))
+ {
+ _bits |= 0x100000L;
+ _headers._AcceptCharset = value;
+ return;
+ }
+ if (ReferenceEquals(HeaderNames.ContentLength, key))
+ {
+ _contentLength = ParseContentLength(value.ToString());
+ return;
+ }
+
+ if (HeaderNames.AcceptCharset.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x100000L;
+ _headers._AcceptCharset = value;
+ return;
+ }
+ if (HeaderNames.ContentLength.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _contentLength = ParseContentLength(value.ToString());
+ return;
+ }
+ break;
}
- tempBits &= ~0x8L;
- }
-
- if ((tempBits & 0x10L) != 0)
- {
- _headers._Pragma = default(StringValues);
- if((tempBits & ~0x10L) == 0)
+ case 15:
{
- return;
+ if (ReferenceEquals(HeaderNames.AcceptEncoding, key))
+ {
+ _bits |= 0x200000L;
+ _headers._AcceptEncoding = value;
+ return;
+ }
+ if (ReferenceEquals(HeaderNames.AcceptLanguage, key))
+ {
+ _bits |= 0x400000L;
+ _headers._AcceptLanguage = value;
+ return;
+ }
+
+ if (HeaderNames.AcceptEncoding.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x200000L;
+ _headers._AcceptEncoding = value;
+ return;
+ }
+ if (HeaderNames.AcceptLanguage.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x400000L;
+ _headers._AcceptLanguage = value;
+ return;
+ }
+ break;
}
- tempBits &= ~0x10L;
- }
-
- if ((tempBits & 0x20L) != 0)
- {
- _headers._Trailer = default(StringValues);
- if((tempBits & ~0x20L) == 0)
+ case 16:
{
- return;
+ if (ReferenceEquals(HeaderNames.ContentEncoding, key))
+ {
+ _bits |= 0x1000L;
+ _headers._ContentEncoding = value;
+ return;
+ }
+ if (ReferenceEquals(HeaderNames.ContentLanguage, key))
+ {
+ _bits |= 0x2000L;
+ _headers._ContentLanguage = value;
+ return;
+ }
+ if (ReferenceEquals(HeaderNames.ContentLocation, key))
+ {
+ _bits |= 0x4000L;
+ _headers._ContentLocation = value;
+ return;
+ }
+
+ if (HeaderNames.ContentEncoding.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x1000L;
+ _headers._ContentEncoding = value;
+ return;
+ }
+ if (HeaderNames.ContentLanguage.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x2000L;
+ _headers._ContentLanguage = value;
+ return;
+ }
+ if (HeaderNames.ContentLocation.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x4000L;
+ _headers._ContentLocation = value;
+ return;
+ }
+ break;
}
- tempBits &= ~0x20L;
- }
-
- if ((tempBits & 0x40L) != 0)
- {
- _headers._TransferEncoding = default(StringValues);
- if((tempBits & ~0x40L) == 0)
+ case 17:
{
- return;
+ if (ReferenceEquals(HeaderNames.TransferEncoding, key))
+ {
+ _bits |= 0x40L;
+ _headers._TransferEncoding = value;
+ return;
+ }
+ if (ReferenceEquals(HeaderNames.IfModifiedSince, key))
+ {
+ _bits |= 0x20000000L;
+ _headers._IfModifiedSince = value;
+ return;
+ }
+
+ if (HeaderNames.TransferEncoding.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x40L;
+ _headers._TransferEncoding = value;
+ return;
+ }
+ if (HeaderNames.IfModifiedSince.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x20000000L;
+ _headers._IfModifiedSince = value;
+ return;
+ }
+ break;
}
- tempBits &= ~0x40L;
- }
-
- if ((tempBits & 0x80L) != 0)
- {
- _headers._Upgrade = default(StringValues);
- if((tempBits & ~0x80L) == 0)
+ case 19:
{
- return;
+ if (ReferenceEquals(HeaderNames.IfUnmodifiedSince, key))
+ {
+ _bits |= 0x100000000L;
+ _headers._IfUnmodifiedSince = value;
+ return;
+ }
+ if (ReferenceEquals(HeaderNames.ProxyAuthorization, key))
+ {
+ _bits |= 0x400000000L;
+ _headers._ProxyAuthorization = value;
+ return;
+ }
+ if (ReferenceEquals(HeaderNames.CorrelationContext, key))
+ {
+ _bits |= 0x80000000000L;
+ _headers._CorrelationContext = value;
+ return;
+ }
+
+ if (HeaderNames.IfUnmodifiedSince.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x100000000L;
+ _headers._IfUnmodifiedSince = value;
+ return;
+ }
+ if (HeaderNames.ProxyAuthorization.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x400000000L;
+ _headers._ProxyAuthorization = value;
+ return;
+ }
+ if (HeaderNames.CorrelationContext.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x80000000000L;
+ _headers._CorrelationContext = value;
+ return;
+ }
+ break;
}
- tempBits &= ~0x80L;
- }
-
- if ((tempBits & 0x100L) != 0)
- {
- _headers._Via = default(StringValues);
- if((tempBits & ~0x100L) == 0)
+ case 25:
{
- return;
+ if (ReferenceEquals(HeaderNames.UpgradeInsecureRequests, key))
+ {
+ _bits |= 0x20000000000L;
+ _headers._UpgradeInsecureRequests = value;
+ return;
+ }
+
+ if (HeaderNames.UpgradeInsecureRequests.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x20000000000L;
+ _headers._UpgradeInsecureRequests = value;
+ return;
+ }
+ break;
}
- tempBits &= ~0x100L;
- }
-
- if ((tempBits & 0x200L) != 0)
- {
- _headers._Warning = default(StringValues);
- if((tempBits & ~0x200L) == 0)
+ case 29:
{
- return;
+ if (ReferenceEquals(HeaderNames.AccessControlRequestMethod, key))
+ {
+ _bits |= 0x800000000000L;
+ _headers._AccessControlRequestMethod = value;
+ return;
+ }
+
+ if (HeaderNames.AccessControlRequestMethod.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x800000000000L;
+ _headers._AccessControlRequestMethod = value;
+ return;
+ }
+ break;
}
- tempBits &= ~0x200L;
- }
-
- if ((tempBits & 0x400L) != 0)
- {
- _headers._Allow = default(StringValues);
- if((tempBits & ~0x400L) == 0)
+ case 30:
{
- return;
+ if (ReferenceEquals(HeaderNames.AccessControlRequestHeaders, key))
+ {
+ _bits |= 0x1000000000000L;
+ _headers._AccessControlRequestHeaders = value;
+ return;
+ }
+
+ if (HeaderNames.AccessControlRequestHeaders.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x1000000000000L;
+ _headers._AccessControlRequestHeaders = value;
+ return;
+ }
+ break;
}
- tempBits &= ~0x400L;
}
-
- if ((tempBits & 0x800L) != 0)
+
+ SetValueUnknown(key, value);
+ }
+
+ protected override bool AddValueFast(string key, StringValues value)
+ {
+ switch (key.Length)
{
- _headers._ContentType = default(StringValues);
- if((tempBits & ~0x800L) == 0)
+ case 2:
{
- return;
+ if (ReferenceEquals(HeaderNames.TE, key))
+ {
+ if ((_bits & 0x2000000000L) == 0)
+ {
+ _bits |= 0x2000000000L;
+ _headers._TE = value;
+ return true;
+ }
+ return false;
+ }
+
+ if (HeaderNames.TE.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x2000000000L) == 0)
+ {
+ _bits |= 0x2000000000L;
+ _headers._TE = value;
+ return true;
+ }
+ return false;
+ }
+ break;
}
- tempBits &= ~0x800L;
- }
-
- if ((tempBits & 0x1000L) != 0)
- {
- _headers._ContentEncoding = default(StringValues);
- if((tempBits & ~0x1000L) == 0)
+ case 3:
{
- return;
- }
- tempBits &= ~0x1000L;
- }
-
- if ((tempBits & 0x2000L) != 0)
- {
- _headers._ContentLanguage = default(StringValues);
- if((tempBits & ~0x2000L) == 0)
- {
- return;
- }
- tempBits &= ~0x2000L;
- }
-
- if ((tempBits & 0x4000L) != 0)
- {
- _headers._ContentLocation = default(StringValues);
- if((tempBits & ~0x4000L) == 0)
- {
- return;
- }
- tempBits &= ~0x4000L;
- }
-
- if ((tempBits & 0x8000L) != 0)
- {
- _headers._ContentMD5 = default(StringValues);
- if((tempBits & ~0x8000L) == 0)
- {
- return;
- }
- tempBits &= ~0x8000L;
- }
-
- if ((tempBits & 0x10000L) != 0)
- {
- _headers._ContentRange = default(StringValues);
- if((tempBits & ~0x10000L) == 0)
- {
- return;
- }
- tempBits &= ~0x10000L;
- }
-
- if ((tempBits & 0x20000L) != 0)
- {
- _headers._Expires = default(StringValues);
- if((tempBits & ~0x20000L) == 0)
- {
- return;
- }
- tempBits &= ~0x20000L;
- }
-
- if ((tempBits & 0x40000L) != 0)
- {
- _headers._LastModified = default(StringValues);
- if((tempBits & ~0x40000L) == 0)
- {
- return;
+ if (ReferenceEquals(HeaderNames.Via, key))
+ {
+ if ((_bits & 0x100L) == 0)
+ {
+ _bits |= 0x100L;
+ _headers._Via = value;
+ return true;
+ }
+ return false;
+ }
+ if (ReferenceEquals(HeaderNames.DNT, key))
+ {
+ if ((_bits & 0x10000000000L) == 0)
+ {
+ _bits |= 0x10000000000L;
+ _headers._DNT = value;
+ return true;
+ }
+ return false;
+ }
+
+ if (HeaderNames.Via.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x100L) == 0)
+ {
+ _bits |= 0x100L;
+ _headers._Via = value;
+ return true;
+ }
+ return false;
+ }
+ if (HeaderNames.DNT.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x10000000000L) == 0)
+ {
+ _bits |= 0x10000000000L;
+ _headers._DNT = value;
+ return true;
+ }
+ return false;
+ }
+ break;
}
- tempBits &= ~0x40000L;
- }
-
- if ((tempBits & 0x100000L) != 0)
- {
- _headers._AcceptCharset = default(StringValues);
- if((tempBits & ~0x100000L) == 0)
+ case 4:
{
- return;
+ if (ReferenceEquals(HeaderNames.Host, key))
+ {
+ if ((_bits & 0x8000000L) == 0)
+ {
+ _bits |= 0x8000000L;
+ _headers._Host = value;
+ return true;
+ }
+ return false;
+ }
+ if (ReferenceEquals(HeaderNames.Date, key))
+ {
+ if ((_bits & 0x4L) == 0)
+ {
+ _bits |= 0x4L;
+ _headers._Date = value;
+ return true;
+ }
+ return false;
+ }
+ if (ReferenceEquals(HeaderNames.From, key))
+ {
+ if ((_bits & 0x4000000L) == 0)
+ {
+ _bits |= 0x4000000L;
+ _headers._From = value;
+ return true;
+ }
+ return false;
+ }
+
+ if (HeaderNames.Host.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x8000000L) == 0)
+ {
+ _bits |= 0x8000000L;
+ _headers._Host = value;
+ return true;
+ }
+ return false;
+ }
+ if (HeaderNames.Date.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x4L) == 0)
+ {
+ _bits |= 0x4L;
+ _headers._Date = value;
+ return true;
+ }
+ return false;
+ }
+ if (HeaderNames.From.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x4000000L) == 0)
+ {
+ _bits |= 0x4000000L;
+ _headers._From = value;
+ return true;
+ }
+ return false;
+ }
+ break;
}
- tempBits &= ~0x100000L;
- }
-
- if ((tempBits & 0x200000L) != 0)
- {
- _headers._AcceptEncoding = default(StringValues);
- if((tempBits & ~0x200000L) == 0)
+ case 5:
{
- return;
+ if (ReferenceEquals(HeaderNames.Allow, key))
+ {
+ if ((_bits & 0x400L) == 0)
+ {
+ _bits |= 0x400L;
+ _headers._Allow = value;
+ return true;
+ }
+ return false;
+ }
+ if (ReferenceEquals(HeaderNames.Range, key))
+ {
+ if ((_bits & 0x1000000000L) == 0)
+ {
+ _bits |= 0x1000000000L;
+ _headers._Range = value;
+ return true;
+ }
+ return false;
+ }
+
+ if (HeaderNames.Allow.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x400L) == 0)
+ {
+ _bits |= 0x400L;
+ _headers._Allow = value;
+ return true;
+ }
+ return false;
+ }
+ if (HeaderNames.Range.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x1000000000L) == 0)
+ {
+ _bits |= 0x1000000000L;
+ _headers._Range = value;
+ return true;
+ }
+ return false;
+ }
+ break;
}
- tempBits &= ~0x200000L;
- }
-
- if ((tempBits & 0x400000L) != 0)
- {
- _headers._AcceptLanguage = default(StringValues);
- if((tempBits & ~0x400000L) == 0)
+ case 6:
{
- return;
+ if (ReferenceEquals(HeaderNames.Accept, key))
+ {
+ if ((_bits & 0x80000L) == 0)
+ {
+ _bits |= 0x80000L;
+ _headers._Accept = value;
+ return true;
+ }
+ return false;
+ }
+ if (ReferenceEquals(HeaderNames.Pragma, key))
+ {
+ if ((_bits & 0x10L) == 0)
+ {
+ _bits |= 0x10L;
+ _headers._Pragma = value;
+ return true;
+ }
+ return false;
+ }
+ if (ReferenceEquals(HeaderNames.Cookie, key))
+ {
+ if ((_bits & 0x1000000L) == 0)
+ {
+ _bits |= 0x1000000L;
+ _headers._Cookie = value;
+ return true;
+ }
+ return false;
+ }
+ if (ReferenceEquals(HeaderNames.Expect, key))
+ {
+ if ((_bits & 0x2000000L) == 0)
+ {
+ _bits |= 0x2000000L;
+ _headers._Expect = value;
+ return true;
+ }
+ return false;
+ }
+ if (ReferenceEquals(HeaderNames.Origin, key))
+ {
+ if ((_bits & 0x400000000000L) == 0)
+ {
+ _bits |= 0x400000000000L;
+ _headers._Origin = value;
+ return true;
+ }
+ return false;
+ }
+
+ if (HeaderNames.Accept.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x80000L) == 0)
+ {
+ _bits |= 0x80000L;
+ _headers._Accept = value;
+ return true;
+ }
+ return false;
+ }
+ if (HeaderNames.Pragma.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x10L) == 0)
+ {
+ _bits |= 0x10L;
+ _headers._Pragma = value;
+ return true;
+ }
+ return false;
+ }
+ if (HeaderNames.Cookie.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x1000000L) == 0)
+ {
+ _bits |= 0x1000000L;
+ _headers._Cookie = value;
+ return true;
+ }
+ return false;
+ }
+ if (HeaderNames.Expect.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x2000000L) == 0)
+ {
+ _bits |= 0x2000000L;
+ _headers._Expect = value;
+ return true;
+ }
+ return false;
+ }
+ if (HeaderNames.Origin.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x400000000000L) == 0)
+ {
+ _bits |= 0x400000000000L;
+ _headers._Origin = value;
+ return true;
+ }
+ return false;
+ }
+ break;
}
- tempBits &= ~0x400000L;
- }
-
- if ((tempBits & 0x800000L) != 0)
- {
- _headers._Authorization = default(StringValues);
- if((tempBits & ~0x800000L) == 0)
+ case 7:
{
- return;
- }
- tempBits &= ~0x800000L;
- }
-
- if ((tempBits & 0x1000000L) != 0)
- {
- _headers._Cookie = default(StringValues);
- if((tempBits & ~0x1000000L) == 0)
- {
- return;
- }
- tempBits &= ~0x1000000L;
- }
-
- if ((tempBits & 0x2000000L) != 0)
- {
- _headers._Expect = default(StringValues);
- if((tempBits & ~0x2000000L) == 0)
- {
- return;
- }
- tempBits &= ~0x2000000L;
- }
-
- if ((tempBits & 0x4000000L) != 0)
- {
- _headers._From = default(StringValues);
- if((tempBits & ~0x4000000L) == 0)
- {
- return;
- }
- tempBits &= ~0x4000000L;
- }
-
- if ((tempBits & 0x10000000L) != 0)
- {
- _headers._IfMatch = default(StringValues);
- if((tempBits & ~0x10000000L) == 0)
- {
- return;
- }
- tempBits &= ~0x10000000L;
- }
-
- if ((tempBits & 0x20000000L) != 0)
- {
- _headers._IfModifiedSince = default(StringValues);
- if((tempBits & ~0x20000000L) == 0)
- {
- return;
- }
- tempBits &= ~0x20000000L;
- }
-
- if ((tempBits & 0x40000000L) != 0)
- {
- _headers._IfNoneMatch = default(StringValues);
- if((tempBits & ~0x40000000L) == 0)
- {
- return;
- }
- tempBits &= ~0x40000000L;
- }
-
- if ((tempBits & 0x80000000L) != 0)
- {
- _headers._IfRange = default(StringValues);
- if((tempBits & ~0x80000000L) == 0)
- {
- return;
- }
- tempBits &= ~0x80000000L;
- }
-
- if ((tempBits & 0x100000000L) != 0)
- {
- _headers._IfUnmodifiedSince = default(StringValues);
- if((tempBits & ~0x100000000L) == 0)
- {
- return;
- }
- tempBits &= ~0x100000000L;
- }
-
- if ((tempBits & 0x200000000L) != 0)
- {
- _headers._MaxForwards = default(StringValues);
- if((tempBits & ~0x200000000L) == 0)
- {
- return;
- }
- tempBits &= ~0x200000000L;
- }
-
- if ((tempBits & 0x400000000L) != 0)
- {
- _headers._ProxyAuthorization = default(StringValues);
- if((tempBits & ~0x400000000L) == 0)
- {
- return;
- }
- tempBits &= ~0x400000000L;
- }
-
- if ((tempBits & 0x800000000L) != 0)
- {
- _headers._Referer = default(StringValues);
- if((tempBits & ~0x800000000L) == 0)
- {
- return;
- }
- tempBits &= ~0x800000000L;
- }
-
- if ((tempBits & 0x1000000000L) != 0)
- {
- _headers._Range = default(StringValues);
- if((tempBits & ~0x1000000000L) == 0)
- {
- return;
- }
- tempBits &= ~0x1000000000L;
- }
-
- if ((tempBits & 0x2000000000L) != 0)
- {
- _headers._TE = default(StringValues);
- if((tempBits & ~0x2000000000L) == 0)
- {
- return;
- }
- tempBits &= ~0x2000000000L;
- }
-
- if ((tempBits & 0x4000000000L) != 0)
- {
- _headers._Translate = default(StringValues);
- if((tempBits & ~0x4000000000L) == 0)
- {
- return;
- }
- tempBits &= ~0x4000000000L;
- }
-
- if ((tempBits & 0x10000000000L) != 0)
- {
- _headers._DNT = default(StringValues);
- if((tempBits & ~0x10000000000L) == 0)
- {
- return;
- }
- tempBits &= ~0x10000000000L;
- }
-
- if ((tempBits & 0x20000000000L) != 0)
- {
- _headers._UpgradeInsecureRequests = default(StringValues);
- if((tempBits & ~0x20000000000L) == 0)
- {
- return;
- }
- tempBits &= ~0x20000000000L;
- }
-
- if ((tempBits & 0x40000000000L) != 0)
- {
- _headers._Origin = default(StringValues);
- if((tempBits & ~0x40000000000L) == 0)
- {
- return;
- }
- tempBits &= ~0x40000000000L;
- }
-
- if ((tempBits & 0x80000000000L) != 0)
- {
- _headers._AccessControlRequestMethod = default(StringValues);
- if((tempBits & ~0x80000000000L) == 0)
- {
- return;
- }
- tempBits &= ~0x80000000000L;
- }
-
- if ((tempBits & 0x100000000000L) != 0)
- {
- _headers._AccessControlRequestHeaders = default(StringValues);
- if((tempBits & ~0x100000000000L) == 0)
- {
- return;
- }
- tempBits &= ~0x100000000000L;
- }
-
- }
-
- protected override bool CopyToFast(KeyValuePair[] array, int arrayIndex)
- {
- if (arrayIndex < 0)
- {
- return false;
- }
-
- if ((_bits & 0x1L) != 0)
- {
- if (arrayIndex == array.Length)
+ if (ReferenceEquals(HeaderNames.Trailer, key))
{
+ if ((_bits & 0x20L) == 0)
+ {
+ _bits |= 0x20L;
+ _headers._Trailer = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Cache-Control", _headers._CacheControl);
- ++arrayIndex;
- }
- if ((_bits & 0x2L) != 0)
- {
- if (arrayIndex == array.Length)
+ if (ReferenceEquals(HeaderNames.Upgrade, key))
{
+ if ((_bits & 0x80L) == 0)
+ {
+ _bits |= 0x80L;
+ _headers._Upgrade = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Connection", _headers._Connection);
- ++arrayIndex;
- }
- if ((_bits & 0x4L) != 0)
- {
- if (arrayIndex == array.Length)
+ if (ReferenceEquals(HeaderNames.Warning, key))
{
+ if ((_bits & 0x200L) == 0)
+ {
+ _bits |= 0x200L;
+ _headers._Warning = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Date", _headers._Date);
- ++arrayIndex;
- }
- if ((_bits & 0x8L) != 0)
- {
- if (arrayIndex == array.Length)
+ if (ReferenceEquals(HeaderNames.Expires, key))
{
+ if ((_bits & 0x20000L) == 0)
+ {
+ _bits |= 0x20000L;
+ _headers._Expires = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Keep-Alive", _headers._KeepAlive);
- ++arrayIndex;
- }
- if ((_bits & 0x10L) != 0)
- {
- if (arrayIndex == array.Length)
+ if (ReferenceEquals(HeaderNames.Referer, key))
{
+ if ((_bits & 0x800000000L) == 0)
+ {
+ _bits |= 0x800000000L;
+ _headers._Referer = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Pragma", _headers._Pragma);
- ++arrayIndex;
- }
- if ((_bits & 0x20L) != 0)
- {
- if (arrayIndex == array.Length)
+
+ if (HeaderNames.Trailer.Equals(key, StringComparison.OrdinalIgnoreCase))
{
+ if ((_bits & 0x20L) == 0)
+ {
+ _bits |= 0x20L;
+ _headers._Trailer = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Trailer", _headers._Trailer);
- ++arrayIndex;
- }
- if ((_bits & 0x40L) != 0)
- {
- if (arrayIndex == array.Length)
+ if (HeaderNames.Upgrade.Equals(key, StringComparison.OrdinalIgnoreCase))
{
+ if ((_bits & 0x80L) == 0)
+ {
+ _bits |= 0x80L;
+ _headers._Upgrade = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Transfer-Encoding", _headers._TransferEncoding);
- ++arrayIndex;
- }
- if ((_bits & 0x80L) != 0)
- {
- if (arrayIndex == array.Length)
+ if (HeaderNames.Warning.Equals(key, StringComparison.OrdinalIgnoreCase))
{
+ if ((_bits & 0x200L) == 0)
+ {
+ _bits |= 0x200L;
+ _headers._Warning = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Upgrade", _headers._Upgrade);
- ++arrayIndex;
- }
- if ((_bits & 0x100L) != 0)
- {
- if (arrayIndex == array.Length)
+ if (HeaderNames.Expires.Equals(key, StringComparison.OrdinalIgnoreCase))
{
+ if ((_bits & 0x20000L) == 0)
+ {
+ _bits |= 0x20000L;
+ _headers._Expires = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Via", _headers._Via);
- ++arrayIndex;
- }
- if ((_bits & 0x200L) != 0)
- {
- if (arrayIndex == array.Length)
+ if (HeaderNames.Referer.Equals(key, StringComparison.OrdinalIgnoreCase))
{
+ if ((_bits & 0x800000000L) == 0)
+ {
+ _bits |= 0x800000000L;
+ _headers._Referer = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Warning", _headers._Warning);
- ++arrayIndex;
+ break;
}
- if ((_bits & 0x400L) != 0)
+ case 8:
{
- if (arrayIndex == array.Length)
+ if (ReferenceEquals(HeaderNames.IfMatch, key))
{
+ if ((_bits & 0x10000000L) == 0)
+ {
+ _bits |= 0x10000000L;
+ _headers._IfMatch = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Allow", _headers._Allow);
- ++arrayIndex;
- }
- if ((_bits & 0x800L) != 0)
- {
- if (arrayIndex == array.Length)
+ if (ReferenceEquals(HeaderNames.IfRange, key))
{
+ if ((_bits & 0x80000000L) == 0)
+ {
+ _bits |= 0x80000000L;
+ _headers._IfRange = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Content-Type", _headers._ContentType);
- ++arrayIndex;
- }
- if ((_bits & 0x1000L) != 0)
- {
- if (arrayIndex == array.Length)
+
+ if (HeaderNames.IfMatch.Equals(key, StringComparison.OrdinalIgnoreCase))
{
+ if ((_bits & 0x10000000L) == 0)
+ {
+ _bits |= 0x10000000L;
+ _headers._IfMatch = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Content-Encoding", _headers._ContentEncoding);
- ++arrayIndex;
- }
- if ((_bits & 0x2000L) != 0)
- {
- if (arrayIndex == array.Length)
+ if (HeaderNames.IfRange.Equals(key, StringComparison.OrdinalIgnoreCase))
{
+ if ((_bits & 0x80000000L) == 0)
+ {
+ _bits |= 0x80000000L;
+ _headers._IfRange = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Content-Language", _headers._ContentLanguage);
- ++arrayIndex;
+ break;
}
- if ((_bits & 0x4000L) != 0)
+ case 9:
{
- if (arrayIndex == array.Length)
+ if (ReferenceEquals(HeaderNames.Translate, key))
{
+ if ((_bits & 0x4000000000L) == 0)
+ {
+ _bits |= 0x4000000000L;
+ _headers._Translate = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Content-Location", _headers._ContentLocation);
- ++arrayIndex;
- }
- if ((_bits & 0x8000L) != 0)
- {
- if (arrayIndex == array.Length)
+
+ if (HeaderNames.Translate.Equals(key, StringComparison.OrdinalIgnoreCase))
{
+ if ((_bits & 0x4000000000L) == 0)
+ {
+ _bits |= 0x4000000000L;
+ _headers._Translate = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Content-MD5", _headers._ContentMD5);
- ++arrayIndex;
+ break;
}
- if ((_bits & 0x10000L) != 0)
+ case 10:
{
- if (arrayIndex == array.Length)
+ if (ReferenceEquals(HeaderNames.Connection, key))
{
+ if ((_bits & 0x2L) == 0)
+ {
+ _bits |= 0x2L;
+ _headers._Connection = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Content-Range", _headers._ContentRange);
- ++arrayIndex;
- }
- if ((_bits & 0x20000L) != 0)
- {
- if (arrayIndex == array.Length)
+ if (ReferenceEquals(HeaderNames.UserAgent, key))
{
+ if ((_bits & 0x8000000000L) == 0)
+ {
+ _bits |= 0x8000000000L;
+ _headers._UserAgent = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Expires", _headers._Expires);
- ++arrayIndex;
- }
- if ((_bits & 0x40000L) != 0)
- {
- if (arrayIndex == array.Length)
+ if (ReferenceEquals(HeaderNames.KeepAlive, key))
{
+ if ((_bits & 0x8L) == 0)
+ {
+ _bits |= 0x8L;
+ _headers._KeepAlive = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Last-Modified", _headers._LastModified);
- ++arrayIndex;
- }
- if ((_bits & 0x80000L) != 0)
- {
- if (arrayIndex == array.Length)
+ if (ReferenceEquals(HeaderNames.RequestId, key))
{
+ if ((_bits & 0x40000000000L) == 0)
+ {
+ _bits |= 0x40000000000L;
+ _headers._RequestId = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Accept", _headers._Accept);
- ++arrayIndex;
- }
- if ((_bits & 0x100000L) != 0)
- {
- if (arrayIndex == array.Length)
+ if (ReferenceEquals(HeaderNames.TraceState, key))
{
+ if ((_bits & 0x200000000000L) == 0)
+ {
+ _bits |= 0x200000000000L;
+ _headers._TraceState = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Accept-Charset", _headers._AcceptCharset);
- ++arrayIndex;
- }
- if ((_bits & 0x200000L) != 0)
- {
- if (arrayIndex == array.Length)
+
+ if (HeaderNames.Connection.Equals(key, StringComparison.OrdinalIgnoreCase))
{
+ if ((_bits & 0x2L) == 0)
+ {
+ _bits |= 0x2L;
+ _headers._Connection = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Accept-Encoding", _headers._AcceptEncoding);
- ++arrayIndex;
- }
- if ((_bits & 0x400000L) != 0)
- {
- if (arrayIndex == array.Length)
+ if (HeaderNames.UserAgent.Equals(key, StringComparison.OrdinalIgnoreCase))
{
+ if ((_bits & 0x8000000000L) == 0)
+ {
+ _bits |= 0x8000000000L;
+ _headers._UserAgent = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Accept-Language", _headers._AcceptLanguage);
- ++arrayIndex;
- }
- if ((_bits & 0x800000L) != 0)
- {
- if (arrayIndex == array.Length)
+ if (HeaderNames.KeepAlive.Equals(key, StringComparison.OrdinalIgnoreCase))
{
+ if ((_bits & 0x8L) == 0)
+ {
+ _bits |= 0x8L;
+ _headers._KeepAlive = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Authorization", _headers._Authorization);
- ++arrayIndex;
- }
- if ((_bits & 0x1000000L) != 0)
- {
- if (arrayIndex == array.Length)
+ if (HeaderNames.RequestId.Equals(key, StringComparison.OrdinalIgnoreCase))
{
+ if ((_bits & 0x40000000000L) == 0)
+ {
+ _bits |= 0x40000000000L;
+ _headers._RequestId = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Cookie", _headers._Cookie);
- ++arrayIndex;
- }
- if ((_bits & 0x2000000L) != 0)
- {
- if (arrayIndex == array.Length)
+ if (HeaderNames.TraceState.Equals(key, StringComparison.OrdinalIgnoreCase))
{
+ if ((_bits & 0x200000000000L) == 0)
+ {
+ _bits |= 0x200000000000L;
+ _headers._TraceState = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Expect", _headers._Expect);
- ++arrayIndex;
+ break;
}
- if ((_bits & 0x4000000L) != 0)
+ case 11:
{
- if (arrayIndex == array.Length)
+ if (ReferenceEquals(HeaderNames.ContentMD5, key))
{
+ if ((_bits & 0x8000L) == 0)
+ {
+ _bits |= 0x8000L;
+ _headers._ContentMD5 = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("From", _headers._From);
- ++arrayIndex;
- }
- if ((_bits & 0x8000000L) != 0)
- {
- if (arrayIndex == array.Length)
+ if (ReferenceEquals(HeaderNames.TraceParent, key))
{
+ if ((_bits & 0x100000000000L) == 0)
+ {
+ _bits |= 0x100000000000L;
+ _headers._TraceParent = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Host", _headers._Host);
- ++arrayIndex;
- }
- if ((_bits & 0x10000000L) != 0)
- {
- if (arrayIndex == array.Length)
+
+ if (HeaderNames.ContentMD5.Equals(key, StringComparison.OrdinalIgnoreCase))
{
+ if ((_bits & 0x8000L) == 0)
+ {
+ _bits |= 0x8000L;
+ _headers._ContentMD5 = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("If-Match", _headers._IfMatch);
- ++arrayIndex;
- }
- if ((_bits & 0x20000000L) != 0)
- {
- if (arrayIndex == array.Length)
+ if (HeaderNames.TraceParent.Equals(key, StringComparison.OrdinalIgnoreCase))
{
+ if ((_bits & 0x100000000000L) == 0)
+ {
+ _bits |= 0x100000000000L;
+ _headers._TraceParent = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("If-Modified-Since", _headers._IfModifiedSince);
- ++arrayIndex;
+ break;
}
- if ((_bits & 0x40000000L) != 0)
+ case 12:
{
- if (arrayIndex == array.Length)
+ if (ReferenceEquals(HeaderNames.ContentType, key))
{
+ if ((_bits & 0x800L) == 0)
+ {
+ _bits |= 0x800L;
+ _headers._ContentType = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("If-None-Match", _headers._IfNoneMatch);
- ++arrayIndex;
- }
- if ((_bits & 0x80000000L) != 0)
- {
- if (arrayIndex == array.Length)
+ if (ReferenceEquals(HeaderNames.MaxForwards, key))
{
+ if ((_bits & 0x200000000L) == 0)
+ {
+ _bits |= 0x200000000L;
+ _headers._MaxForwards = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("If-Range", _headers._IfRange);
- ++arrayIndex;
- }
- if ((_bits & 0x100000000L) != 0)
- {
- if (arrayIndex == array.Length)
+
+ if (HeaderNames.ContentType.Equals(key, StringComparison.OrdinalIgnoreCase))
{
+ if ((_bits & 0x800L) == 0)
+ {
+ _bits |= 0x800L;
+ _headers._ContentType = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("If-Unmodified-Since", _headers._IfUnmodifiedSince);
- ++arrayIndex;
- }
- if ((_bits & 0x200000000L) != 0)
- {
- if (arrayIndex == array.Length)
+ if (HeaderNames.MaxForwards.Equals(key, StringComparison.OrdinalIgnoreCase))
{
+ if ((_bits & 0x200000000L) == 0)
+ {
+ _bits |= 0x200000000L;
+ _headers._MaxForwards = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Max-Forwards", _headers._MaxForwards);
- ++arrayIndex;
+ break;
}
- if ((_bits & 0x400000000L) != 0)
+ case 13:
{
- if (arrayIndex == array.Length)
+ if (ReferenceEquals(HeaderNames.CacheControl, key))
{
+ if ((_bits & 0x1L) == 0)
+ {
+ _bits |= 0x1L;
+ _headers._CacheControl = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Proxy-Authorization", _headers._ProxyAuthorization);
- ++arrayIndex;
- }
- if ((_bits & 0x800000000L) != 0)
- {
- if (arrayIndex == array.Length)
+ if (ReferenceEquals(HeaderNames.ContentRange, key))
{
+ if ((_bits & 0x10000L) == 0)
+ {
+ _bits |= 0x10000L;
+ _headers._ContentRange = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Referer", _headers._Referer);
- ++arrayIndex;
- }
- if ((_bits & 0x1000000000L) != 0)
- {
- if (arrayIndex == array.Length)
+ if (ReferenceEquals(HeaderNames.LastModified, key))
{
+ if ((_bits & 0x40000L) == 0)
+ {
+ _bits |= 0x40000L;
+ _headers._LastModified = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Range", _headers._Range);
- ++arrayIndex;
- }
- if ((_bits & 0x2000000000L) != 0)
- {
- if (arrayIndex == array.Length)
+ if (ReferenceEquals(HeaderNames.Authorization, key))
{
+ if ((_bits & 0x800000L) == 0)
+ {
+ _bits |= 0x800000L;
+ _headers._Authorization = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("TE", _headers._TE);
- ++arrayIndex;
- }
- if ((_bits & 0x4000000000L) != 0)
- {
- if (arrayIndex == array.Length)
+ if (ReferenceEquals(HeaderNames.IfNoneMatch, key))
{
+ if ((_bits & 0x40000000L) == 0)
+ {
+ _bits |= 0x40000000L;
+ _headers._IfNoneMatch = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Translate", _headers._Translate);
- ++arrayIndex;
- }
- if ((_bits & 0x8000000000L) != 0)
- {
- if (arrayIndex == array.Length)
+
+ if (HeaderNames.CacheControl.Equals(key, StringComparison.OrdinalIgnoreCase))
{
+ if ((_bits & 0x1L) == 0)
+ {
+ _bits |= 0x1L;
+ _headers._CacheControl = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("User-Agent", _headers._UserAgent);
- ++arrayIndex;
- }
- if ((_bits & 0x10000000000L) != 0)
- {
- if (arrayIndex == array.Length)
+ if (HeaderNames.ContentRange.Equals(key, StringComparison.OrdinalIgnoreCase))
{
+ if ((_bits & 0x10000L) == 0)
+ {
+ _bits |= 0x10000L;
+ _headers._ContentRange = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("DNT", _headers._DNT);
- ++arrayIndex;
- }
- if ((_bits & 0x20000000000L) != 0)
- {
- if (arrayIndex == array.Length)
+ if (HeaderNames.LastModified.Equals(key, StringComparison.OrdinalIgnoreCase))
{
+ if ((_bits & 0x40000L) == 0)
+ {
+ _bits |= 0x40000L;
+ _headers._LastModified = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Upgrade-Insecure-Requests", _headers._UpgradeInsecureRequests);
- ++arrayIndex;
- }
- if ((_bits & 0x40000000000L) != 0)
- {
- if (arrayIndex == array.Length)
+ if (HeaderNames.Authorization.Equals(key, StringComparison.OrdinalIgnoreCase))
{
+ if ((_bits & 0x800000L) == 0)
+ {
+ _bits |= 0x800000L;
+ _headers._Authorization = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Origin", _headers._Origin);
- ++arrayIndex;
- }
- if ((_bits & 0x80000000000L) != 0)
- {
- if (arrayIndex == array.Length)
+ if (HeaderNames.IfNoneMatch.Equals(key, StringComparison.OrdinalIgnoreCase))
{
+ if ((_bits & 0x40000000L) == 0)
+ {
+ _bits |= 0x40000000L;
+ _headers._IfNoneMatch = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Access-Control-Request-Method", _headers._AccessControlRequestMethod);
- ++arrayIndex;
+ break;
}
- if ((_bits & 0x100000000000L) != 0)
+ case 14:
{
- if (arrayIndex == array.Length)
+ if (ReferenceEquals(HeaderNames.AcceptCharset, key))
{
+ if ((_bits & 0x100000L) == 0)
+ {
+ _bits |= 0x100000L;
+ _headers._AcceptCharset = value;
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Access-Control-Request-Headers", _headers._AccessControlRequestHeaders);
- ++arrayIndex;
- }
- if (_contentLength.HasValue)
- {
- if (arrayIndex == array.Length)
+ if (ReferenceEquals(HeaderNames.ContentLength, key))
{
+ if (!_contentLength.HasValue)
+ {
+ _contentLength = ParseContentLength(value);
+ return true;
+ }
return false;
}
- array[arrayIndex] = new KeyValuePair("Content-Length", HeaderUtilities.FormatNonNegativeInt64(_contentLength.Value));
- ++arrayIndex;
- }
- ((ICollection>)MaybeUnknown)?.CopyTo(array, arrayIndex);
-
- return true;
- }
-
- [MethodImpl(MethodImplOptions.AggressiveOptimization)]
- public unsafe void Append(Span name, Span value)
- {
- ref byte nameStart = ref MemoryMarshal.GetReference(name);
- ref StringValues values = ref Unsafe.AsRef(null);
- var flag = 0L;
-
- // Does the name matched any "known" headers
- switch (name.Length)
- {
- case 2:
- if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfu) == 0x4554u))
+
+ if (HeaderNames.AcceptCharset.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- flag = 0x2000000000L;
- values = ref _headers._TE;
+ if ((_bits & 0x100000L) == 0)
+ {
+ _bits |= 0x100000L;
+ _headers._AcceptCharset = value;
+ return true;
+ }
+ return false;
}
- break;
- case 3:
- var firstTerm3 = (Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfu);
- if ((firstTerm3 == 0x4e44u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)2) & 0xdfu) == 0x54u))
+ if (HeaderNames.ContentLength.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- flag = 0x10000000000L;
- values = ref _headers._DNT;
+ if (!_contentLength.HasValue)
+ {
+ _contentLength = ParseContentLength(value);
+ return true;
+ }
+ return false;
}
- else if ((firstTerm3 == 0x4956u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)2) & 0xdfu) == 0x41u))
+ break;
+ }
+ case 15:
+ {
+ if (ReferenceEquals(HeaderNames.AcceptEncoding, key))
{
- flag = 0x100L;
- values = ref _headers._Via;
+ if ((_bits & 0x200000L) == 0)
+ {
+ _bits |= 0x200000L;
+ _headers._AcceptEncoding = value;
+ return true;
+ }
+ return false;
}
- break;
- case 4:
- var firstTerm4 = (Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfu);
- if ((firstTerm4 == 0x54534f48u))
+ if (ReferenceEquals(HeaderNames.AcceptLanguage, key))
{
- flag = 0x8000000L;
- values = ref _headers._Host;
+ if ((_bits & 0x400000L) == 0)
+ {
+ _bits |= 0x400000L;
+ _headers._AcceptLanguage = value;
+ return true;
+ }
+ return false;
}
- else if ((firstTerm4 == 0x45544144u))
+
+ if (HeaderNames.AcceptEncoding.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- flag = 0x4L;
- values = ref _headers._Date;
+ if ((_bits & 0x200000L) == 0)
+ {
+ _bits |= 0x200000L;
+ _headers._AcceptEncoding = value;
+ return true;
+ }
+ return false;
}
- else if ((firstTerm4 == 0x4d4f5246u))
+ if (HeaderNames.AcceptLanguage.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- flag = 0x4000000L;
- values = ref _headers._From;
+ if ((_bits & 0x400000L) == 0)
+ {
+ _bits |= 0x400000L;
+ _headers._AcceptLanguage = value;
+ return true;
+ }
+ return false;
}
break;
- case 5:
- var firstTerm5 = (Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfu);
- if ((firstTerm5 == 0x4f4c4c41u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)4) & 0xdfu) == 0x57u))
+ }
+ case 16:
+ {
+ if (ReferenceEquals(HeaderNames.ContentEncoding, key))
{
- flag = 0x400L;
- values = ref _headers._Allow;
+ if ((_bits & 0x1000L) == 0)
+ {
+ _bits |= 0x1000L;
+ _headers._ContentEncoding = value;
+ return true;
+ }
+ return false;
}
- else if ((firstTerm5 == 0x474e4152u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)4) & 0xdfu) == 0x45u))
+ if (ReferenceEquals(HeaderNames.ContentLanguage, key))
{
- flag = 0x1000000000L;
- values = ref _headers._Range;
+ if ((_bits & 0x2000L) == 0)
+ {
+ _bits |= 0x2000L;
+ _headers._ContentLanguage = value;
+ return true;
+ }
+ return false;
}
- break;
- case 6:
- var firstTerm6 = (Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfu);
- if ((firstTerm6 == 0x45434341u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x5450u))
+ if (ReferenceEquals(HeaderNames.ContentLocation, key))
{
- flag = 0x80000L;
- values = ref _headers._Accept;
+ if ((_bits & 0x4000L) == 0)
+ {
+ _bits |= 0x4000L;
+ _headers._ContentLocation = value;
+ return true;
+ }
+ return false;
}
- else if ((firstTerm6 == 0x4b4f4f43u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x4549u))
+
+ if (HeaderNames.ContentEncoding.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- flag = 0x1000000L;
- values = ref _headers._Cookie;
+ if ((_bits & 0x1000L) == 0)
+ {
+ _bits |= 0x1000L;
+ _headers._ContentEncoding = value;
+ return true;
+ }
+ return false;
}
- else if ((firstTerm6 == 0x45505845u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x5443u))
+ if (HeaderNames.ContentLanguage.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- flag = 0x2000000L;
- values = ref _headers._Expect;
+ if ((_bits & 0x2000L) == 0)
+ {
+ _bits |= 0x2000L;
+ _headers._ContentLanguage = value;
+ return true;
+ }
+ return false;
}
- else if ((firstTerm6 == 0x4749524fu) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x4e49u))
+ if (HeaderNames.ContentLocation.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- flag = 0x40000000000L;
- values = ref _headers._Origin;
+ if ((_bits & 0x4000L) == 0)
+ {
+ _bits |= 0x4000L;
+ _headers._ContentLocation = value;
+ return true;
+ }
+ return false;
}
- else if ((firstTerm6 == 0x47415250u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x414du))
+ break;
+ }
+ case 17:
+ {
+ if (ReferenceEquals(HeaderNames.TransferEncoding, key))
{
- flag = 0x10L;
- values = ref _headers._Pragma;
+ if ((_bits & 0x40L) == 0)
+ {
+ _bits |= 0x40L;
+ _headers._TransferEncoding = value;
+ return true;
+ }
+ return false;
}
- break;
- case 7:
- var firstTerm7 = (Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfu);
- if ((firstTerm7 == 0x49505845u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x4552u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)6) & 0xdfu) == 0x53u))
+ if (ReferenceEquals(HeaderNames.IfModifiedSince, key))
{
- flag = 0x20000L;
- values = ref _headers._Expires;
+ if ((_bits & 0x20000000L) == 0)
+ {
+ _bits |= 0x20000000L;
+ _headers._IfModifiedSince = value;
+ return true;
+ }
+ return false;
}
- else if ((firstTerm7 == 0x45464552u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x4552u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)6) & 0xdfu) == 0x52u))
+
+ if (HeaderNames.TransferEncoding.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- flag = 0x800000000L;
- values = ref _headers._Referer;
+ if ((_bits & 0x40L) == 0)
+ {
+ _bits |= 0x40L;
+ _headers._TransferEncoding = value;
+ return true;
+ }
+ return false;
}
- else if ((firstTerm7 == 0x49415254u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x454cu) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)6) & 0xdfu) == 0x52u))
+ if (HeaderNames.IfModifiedSince.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- flag = 0x20L;
- values = ref _headers._Trailer;
+ if ((_bits & 0x20000000L) == 0)
+ {
+ _bits |= 0x20000000L;
+ _headers._IfModifiedSince = value;
+ return true;
+ }
+ return false;
}
- else if ((firstTerm7 == 0x52475055u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x4441u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)6) & 0xdfu) == 0x45u))
+ break;
+ }
+ case 19:
+ {
+ if (ReferenceEquals(HeaderNames.IfUnmodifiedSince, key))
{
- flag = 0x80L;
- values = ref _headers._Upgrade;
+ if ((_bits & 0x100000000L) == 0)
+ {
+ _bits |= 0x100000000L;
+ _headers._IfUnmodifiedSince = value;
+ return true;
+ }
+ return false;
}
- else if ((firstTerm7 == 0x4e524157u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x4e49u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)6) & 0xdfu) == 0x47u))
+ if (ReferenceEquals(HeaderNames.ProxyAuthorization, key))
{
- flag = 0x200L;
- values = ref _headers._Warning;
+ if ((_bits & 0x400000000L) == 0)
+ {
+ _bits |= 0x400000000L;
+ _headers._ProxyAuthorization = value;
+ return true;
+ }
+ return false;
}
- break;
- case 8:
- var firstTerm8 = (Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfdfffdfdfuL);
- if ((firstTerm8 == 0x484354414d2d4649uL))
+ if (ReferenceEquals(HeaderNames.CorrelationContext, key))
{
- flag = 0x10000000L;
- values = ref _headers._IfMatch;
+ if ((_bits & 0x80000000000L) == 0)
+ {
+ _bits |= 0x80000000000L;
+ _headers._CorrelationContext = value;
+ return true;
+ }
+ return false;
}
- else if ((firstTerm8 == 0x45474e41522d4649uL))
+
+ if (HeaderNames.IfUnmodifiedSince.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- flag = 0x80000000L;
- values = ref _headers._IfRange;
+ if ((_bits & 0x100000000L) == 0)
+ {
+ _bits |= 0x100000000L;
+ _headers._IfUnmodifiedSince = value;
+ return true;
+ }
+ return false;
}
- break;
- case 9:
- if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfdfdfdfdfuL) == 0x54414c534e415254uL) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)8) & 0xdfu) == 0x45u))
+ if (HeaderNames.ProxyAuthorization.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- flag = 0x4000000000L;
- values = ref _headers._Translate;
+ if ((_bits & 0x400000000L) == 0)
+ {
+ _bits |= 0x400000000L;
+ _headers._ProxyAuthorization = value;
+ return true;
+ }
+ return false;
}
- break;
- case 10:
- if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfdfdfdfdfuL) == 0x495443454e4e4f43uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(4 * sizeof(ushort)))) & 0xdfdfu) == 0x4e4fu))
+ if (HeaderNames.CorrelationContext.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- flag = 0x2L;
- values = ref _headers._Connection;
+ if ((_bits & 0x80000000000L) == 0)
+ {
+ _bits |= 0x80000000000L;
+ _headers._CorrelationContext = value;
+ return true;
+ }
+ return false;
}
- else if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfffdfdfdfdfuL) == 0x4547412d52455355uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(4 * sizeof(ushort)))) & 0xdfdfu) == 0x544eu))
+ break;
+ }
+ case 25:
+ {
+ if (ReferenceEquals(HeaderNames.UpgradeInsecureRequests, key))
{
- flag = 0x8000000000L;
- values = ref _headers._UserAgent;
+ if ((_bits & 0x20000000000L) == 0)
+ {
+ _bits |= 0x20000000000L;
+ _headers._UpgradeInsecureRequests = value;
+ return true;
+ }
+ return false;
}
- else if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfffdfdfdfdfuL) == 0x494c412d5045454buL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(4 * sizeof(ushort)))) & 0xdfdfu) == 0x4556u))
+
+ if (HeaderNames.UpgradeInsecureRequests.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- flag = 0x8L;
- values = ref _headers._KeepAlive;
+ if ((_bits & 0x20000000000L) == 0)
+ {
+ _bits |= 0x20000000000L;
+ _headers._UpgradeInsecureRequests = value;
+ return true;
+ }
+ return false;
}
break;
- case 11:
- if (((Unsafe.ReadUnaligned(ref nameStart) & 0xffdfdfdfdfdfdfdfuL) == 0x2d544e45544e4f43uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(4 * sizeof(ushort)))) & 0xdfdfu) == 0x444du) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)10) & 0xffu) == 0x35u))
+ }
+ case 29:
+ {
+ if (ReferenceEquals(HeaderNames.AccessControlRequestMethod, key))
{
- flag = 0x8000L;
- values = ref _headers._ContentMD5;
+ if ((_bits & 0x800000000000L) == 0)
+ {
+ _bits |= 0x800000000000L;
+ _headers._AccessControlRequestMethod = value;
+ return true;
+ }
+ return false;
+ }
+
+ if (HeaderNames.AccessControlRequestMethod.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x800000000000L) == 0)
+ {
+ _bits |= 0x800000000000L;
+ _headers._AccessControlRequestMethod = value;
+ return true;
+ }
+ return false;
}
break;
- case 12:
- if (((Unsafe.ReadUnaligned(ref nameStart) & 0xffdfdfdfdfdfdfdfuL) == 0x2d544e45544e4f43uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x45505954u))
+ }
+ case 30:
+ {
+ if (ReferenceEquals(HeaderNames.AccessControlRequestHeaders, key))
{
- flag = 0x800L;
- values = ref _headers._ContentType;
+ if ((_bits & 0x1000000000000L) == 0)
+ {
+ _bits |= 0x1000000000000L;
+ _headers._AccessControlRequestHeaders = value;
+ return true;
+ }
+ return false;
}
- else if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfffdfdfdfuL) == 0x57524f462d58414duL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x53445241u))
+
+ if (HeaderNames.AccessControlRequestHeaders.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- flag = 0x200000000L;
- values = ref _headers._MaxForwards;
+ if ((_bits & 0x1000000000000L) == 0)
+ {
+ _bits |= 0x1000000000000L;
+ _headers._AccessControlRequestHeaders = value;
+ return true;
+ }
+ return false;
}
break;
- case 13:
- if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfdfdfdfdfuL) == 0x5a49524f48545541uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x4f495441u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)12) & 0xdfu) == 0x4eu))
+ }
+ }
+
+ return AddValueUnknown(key, value);
+ }
+
+ protected override bool RemoveFast(string key)
+ {
+ switch (key.Length)
+ {
+ case 2:
+ {
+ if (ReferenceEquals(HeaderNames.TE, key))
{
- flag = 0x800000L;
- values = ref _headers._Authorization;
+ if ((_bits & 0x2000000000L) != 0)
+ {
+ _bits &= ~0x2000000000L;
+ _headers._TE = default(StringValues);
+ return true;
+ }
+ return false;
}
- else if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfffdfdfdfdfdfuL) == 0x4f432d4548434143uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x4f52544eu) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)12) & 0xdfu) == 0x4cu))
+
+ if (HeaderNames.TE.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- flag = 0x1L;
- values = ref _headers._CacheControl;
+ if ((_bits & 0x2000000000L) != 0)
+ {
+ _bits &= ~0x2000000000L;
+ _headers._TE = default(StringValues);
+ return true;
+ }
+ return false;
}
- else if (((Unsafe.ReadUnaligned(ref nameStart) & 0xffdfdfdfdfdfdfdfuL) == 0x2d544e45544e4f43uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x474e4152u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)12) & 0xdfu) == 0x45u))
+ break;
+ }
+ case 3:
+ {
+ if (ReferenceEquals(HeaderNames.Via, key))
{
- flag = 0x10000L;
- values = ref _headers._ContentRange;
+ if ((_bits & 0x100L) != 0)
+ {
+ _bits &= ~0x100L;
+ _headers._Via = default(StringValues);
+ return true;
+ }
+ return false;
}
- else if (((Unsafe.ReadUnaligned(ref nameStart) & 0xffdfdfdfdfffdfdfuL) == 0x2d454e4f4e2d4649uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x4354414du) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)12) & 0xdfu) == 0x48u))
+ if (ReferenceEquals(HeaderNames.DNT, key))
{
- flag = 0x40000000L;
- values = ref _headers._IfNoneMatch;
+ if ((_bits & 0x10000000000L) != 0)
+ {
+ _bits &= ~0x10000000000L;
+ _headers._DNT = default(StringValues);
+ return true;
+ }
+ return false;
}
- else if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfffdfdfdfdfuL) == 0x444f4d2d5453414cuL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x45494649u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)12) & 0xdfu) == 0x44u))
+
+ if (HeaderNames.Via.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- flag = 0x40000L;
- values = ref _headers._LastModified;
+ if ((_bits & 0x100L) != 0)
+ {
+ _bits &= ~0x100L;
+ _headers._Via = default(StringValues);
+ return true;
+ }
+ return false;
}
- break;
- case 14:
- if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfffdfdfdfdfdfdfuL) == 0x432d545045434341uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x53524148u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(6 * sizeof(ushort)))) & 0xdfdfu) == 0x5445u))
+ if (HeaderNames.DNT.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- flag = 0x100000L;
- values = ref _headers._AcceptCharset;
+ if ((_bits & 0x10000000000L) != 0)
+ {
+ _bits &= ~0x10000000000L;
+ _headers._DNT = default(StringValues);
+ return true;
+ }
+ return false;
}
- else if (((Unsafe.ReadUnaligned(ref nameStart) & 0xffdfdfdfdfdfdfdfuL) == 0x2d544e45544e4f43uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x474e454cu) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(6 * sizeof(ushort)))) & 0xdfdfu) == 0x4854u))
+ break;
+ }
+ case 4:
+ {
+ if (ReferenceEquals(HeaderNames.Host, key))
{
- AppendContentLength(value);
- return;
+ if ((_bits & 0x8000000L) != 0)
+ {
+ _bits &= ~0x8000000L;
+ _headers._Host = default(StringValues);
+ return true;
+ }
+ return false;
}
- break;
- case 15:
- var firstTerm15 = (Unsafe.ReadUnaligned(ref nameStart) & 0xdfffdfdfdfdfdfdfuL);
- if ((firstTerm15 == 0x452d545045434341uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x444f434eu) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(6 * sizeof(ushort)))) & 0xdfdfu) == 0x4e49u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)14) & 0xdfu) == 0x47u))
+ if (ReferenceEquals(HeaderNames.Date, key))
{
- flag = 0x200000L;
- values = ref _headers._AcceptEncoding;
+ if ((_bits & 0x4L) != 0)
+ {
+ _bits &= ~0x4L;
+ _headers._Date = default(StringValues);
+ return true;
+ }
+ return false;
}
- else if ((firstTerm15 == 0x4c2d545045434341uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x55474e41u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(6 * sizeof(ushort)))) & 0xdfdfu) == 0x4741u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)14) & 0xdfu) == 0x45u))
+ if (ReferenceEquals(HeaderNames.From, key))
{
- flag = 0x400000L;
- values = ref _headers._AcceptLanguage;
+ if ((_bits & 0x4000000L) != 0)
+ {
+ _bits &= ~0x4000000L;
+ _headers._From = default(StringValues);
+ return true;
+ }
+ return false;
}
- break;
- case 16:
- var firstTerm16 = (Unsafe.ReadUnaligned(ref nameStart) & 0xffdfdfdfdfdfdfdfuL);
- if ((firstTerm16 == 0x2d544e45544e4f43uL))
+
+ if (HeaderNames.Host.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if (((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)sizeof(ulong))) & 0xdfdfdfdfdfdfdfdfuL) == 0x474e49444f434e45uL))
+ if ((_bits & 0x8000000L) != 0)
{
- flag = 0x1000L;
- values = ref _headers._ContentEncoding;
+ _bits &= ~0x8000000L;
+ _headers._Host = default(StringValues);
+ return true;
}
- else if (((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)sizeof(ulong))) & 0xdfdfdfdfdfdfdfdfuL) == 0x45474155474e414cuL))
+ return false;
+ }
+ if (HeaderNames.Date.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x4L) != 0)
{
- flag = 0x2000L;
- values = ref _headers._ContentLanguage;
+ _bits &= ~0x4L;
+ _headers._Date = default(StringValues);
+ return true;
}
- else if (((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)sizeof(ulong))) & 0xdfdfdfdfdfdfdfdfuL) == 0x4e4f495441434f4cuL))
+ return false;
+ }
+ if (HeaderNames.From.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x4000000L) != 0)
{
- flag = 0x4000L;
- values = ref _headers._ContentLocation;
+ _bits &= ~0x4000000L;
+ _headers._From = default(StringValues);
+ return true;
}
+ return false;
}
break;
- case 17:
- if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfdfffdfdfuL) == 0x4649444f4d2d4649uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)sizeof(ulong))) & 0xdfdfdfdfffdfdfdfuL) == 0x434e49532d444549uL) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)16) & 0xdfu) == 0x45u))
+ }
+ case 5:
+ {
+ if (ReferenceEquals(HeaderNames.Allow, key))
{
- flag = 0x20000000L;
- values = ref _headers._IfModifiedSince;
+ if ((_bits & 0x400L) != 0)
+ {
+ _bits &= ~0x400L;
+ _headers._Allow = default(StringValues);
+ return true;
+ }
+ return false;
}
- else if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfdfdfdfdfuL) == 0x524546534e415254uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)sizeof(ulong))) & 0xdfdfdfdfdfdfdfffuL) == 0x4e49444f434e452duL) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)16) & 0xdfu) == 0x47u))
+ if (ReferenceEquals(HeaderNames.Range, key))
{
- flag = 0x40L;
- values = ref _headers._TransferEncoding;
+ if ((_bits & 0x1000000000L) != 0)
+ {
+ _bits &= ~0x1000000000L;
+ _headers._Range = default(StringValues);
+ return true;
+ }
+ return false;
}
- break;
- case 19:
- if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfdfffdfdfuL) == 0x444f4d4e552d4649uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)sizeof(ulong))) & 0xdfdfffdfdfdfdfdfuL) == 0x49532d4445494649uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(8 * sizeof(ushort)))) & 0xdfdfu) == 0x434eu) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)18) & 0xdfu) == 0x45u))
+
+ if (HeaderNames.Allow.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- flag = 0x100000000L;
- values = ref _headers._IfUnmodifiedSince;
+ if ((_bits & 0x400L) != 0)
+ {
+ _bits &= ~0x400L;
+ _headers._Allow = default(StringValues);
+ return true;
+ }
+ return false;
}
- else if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfffdfdfdfdfdfuL) == 0x55412d59584f5250uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)sizeof(ulong))) & 0xdfdfdfdfdfdfdfdfuL) == 0x54415a49524f4854uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(8 * sizeof(ushort)))) & 0xdfdfu) == 0x4f49u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)18) & 0xdfu) == 0x4eu))
+ if (HeaderNames.Range.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- flag = 0x400000000L;
- values = ref _headers._ProxyAuthorization;
+ if ((_bits & 0x1000000000L) != 0)
+ {
+ _bits &= ~0x1000000000L;
+ _headers._Range = default(StringValues);
+ return true;
+ }
+ return false;
}
break;
- case 25:
- if (((Unsafe.ReadUnaligned(ref nameStart) & 0xffdfdfdfdfdfdfdfuL) == 0x2d45444152475055uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)sizeof(ulong))) & 0xdfdfdfdfdfdfdfdfuL) == 0x4552554345534e49uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ulong)))) & 0xdfdfdfdfdfdfdfffuL) == 0x545345555145522duL) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)24) & 0xdfu) == 0x53u))
+ }
+ case 6:
+ {
+ if (ReferenceEquals(HeaderNames.Accept, key))
{
- flag = 0x20000000000L;
- values = ref _headers._UpgradeInsecureRequests;
+ if ((_bits & 0x80000L) != 0)
+ {
+ _bits &= ~0x80000L;
+ _headers._Accept = default(StringValues);
+ return true;
+ }
+ return false;
}
- break;
- case 29:
- if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfffdfdfdfdfdfdfuL) == 0x432d535345434341uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)sizeof(ulong))) & 0xdfffdfdfdfdfdfdfuL) == 0x522d4c4f52544e4fuL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ulong)))) & 0xdfffdfdfdfdfdfdfuL) == 0x4d2d545345555145uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(6 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x4f485445u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)28) & 0xdfu) == 0x44u))
+ if (ReferenceEquals(HeaderNames.Pragma, key))
{
- flag = 0x80000000000L;
- values = ref _headers._AccessControlRequestMethod;
+ if ((_bits & 0x10L) != 0)
+ {
+ _bits &= ~0x10L;
+ _headers._Pragma = default(StringValues);
+ return true;
+ }
+ return false;
}
- break;
- case 30:
- if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfffdfdfdfdfdfdfuL) == 0x432d535345434341uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)sizeof(ulong))) & 0xdfffdfdfdfdfdfdfuL) == 0x522d4c4f52544e4fuL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ulong)))) & 0xdfffdfdfdfdfdfdfuL) == 0x482d545345555145uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(6 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x45444145u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(14 * sizeof(ushort)))) & 0xdfdfu) == 0x5352u))
+ if (ReferenceEquals(HeaderNames.Cookie, key))
{
- flag = 0x100000000000L;
- values = ref _headers._AccessControlRequestHeaders;
+ if ((_bits & 0x1000000L) != 0)
+ {
+ _bits &= ~0x1000000L;
+ _headers._Cookie = default(StringValues);
+ return true;
+ }
+ return false;
}
- break;
- }
-
- if (flag != 0)
- {
- // Matched a known header
- if ((_previousBits & flag) != 0)
- {
- // Had a previous string for this header, mark it as used so we don't clear it OnHeadersComplete or consider it if we get a second header
- _previousBits ^= flag;
-
- // We will only reuse this header if there was only one previous header
- if (values.Count == 1)
+ if (ReferenceEquals(HeaderNames.Expect, key))
{
- var previousValue = values.ToString();
- // Check lengths are the same, then if the bytes were converted to an ascii string if they would be the same.
- // We do not consider Utf8 headers for reuse.
- if (previousValue.Length == value.Length &&
- StringUtilities.BytesOrdinalEqualsStringAndAscii(previousValue, value))
+ if ((_bits & 0x2000000L) != 0)
{
- // The previous string matches what the bytes would convert to, so we will just use that one.
- _bits |= flag;
- return;
+ _bits &= ~0x2000000L;
+ _headers._Expect = default(StringValues);
+ return true;
}
+ return false;
}
- }
-
- // We didn't have a previous matching header value, or have already added a header, so get the string for this value.
- var valueStr = value.GetAsciiOrUTF8StringNonNullCharacters();
- if ((_bits & flag) == 0)
- {
- // We didn't already have a header set, so add a new one.
- _bits |= flag;
- values = new StringValues(valueStr);
- }
- else
- {
- // We already had a header set, so concatenate the new one.
- values = AppendValue(values, valueStr);
- }
- }
- else
- {
- // The header was not one of the "known" headers.
- // Convert value to string first, because passing two spans causes 8 bytes stack zeroing in
- // this method with rep stosd, which is slower than necessary.
- var valueStr = value.GetAsciiOrUTF8StringNonNullCharacters();
- AppendUnknownHeaders(name, valueStr);
- }
- }
-
- private struct HeaderReferences
- {
- public StringValues _CacheControl;
- public StringValues _Connection;
- public StringValues _Date;
- public StringValues _KeepAlive;
- public StringValues _Pragma;
- public StringValues _Trailer;
- public StringValues _TransferEncoding;
- public StringValues _Upgrade;
- public StringValues _Via;
- public StringValues _Warning;
- public StringValues _Allow;
- public StringValues _ContentType;
- public StringValues _ContentEncoding;
- public StringValues _ContentLanguage;
- public StringValues _ContentLocation;
- public StringValues _ContentMD5;
- public StringValues _ContentRange;
- public StringValues _Expires;
- public StringValues _LastModified;
- public StringValues _Accept;
- public StringValues _AcceptCharset;
- public StringValues _AcceptEncoding;
- public StringValues _AcceptLanguage;
- public StringValues _Authorization;
- public StringValues _Cookie;
- public StringValues _Expect;
- public StringValues _From;
- public StringValues _Host;
- public StringValues _IfMatch;
- public StringValues _IfModifiedSince;
- public StringValues _IfNoneMatch;
- public StringValues _IfRange;
- public StringValues _IfUnmodifiedSince;
- public StringValues _MaxForwards;
- public StringValues _ProxyAuthorization;
- public StringValues _Referer;
- public StringValues _Range;
- public StringValues _TE;
- public StringValues _Translate;
- public StringValues _UserAgent;
- public StringValues _DNT;
- public StringValues _UpgradeInsecureRequests;
- public StringValues _Origin;
- public StringValues _AccessControlRequestMethod;
- public StringValues _AccessControlRequestHeaders;
-
- }
-
- public partial struct Enumerator
- {
- // Compiled to Jump table
- public bool MoveNext()
- {
- switch (_next)
- {
- case 0:
- goto HeaderCacheControl;
- case 1:
- goto HeaderConnection;
- case 2:
- goto HeaderDate;
- case 3:
- goto HeaderKeepAlive;
- case 4:
- goto HeaderPragma;
- case 5:
- goto HeaderTrailer;
- case 6:
- goto HeaderTransferEncoding;
- case 7:
- goto HeaderUpgrade;
- case 8:
- goto HeaderVia;
- case 9:
- goto HeaderWarning;
- case 10:
- goto HeaderAllow;
- case 11:
- goto HeaderContentType;
- case 12:
- goto HeaderContentEncoding;
- case 13:
- goto HeaderContentLanguage;
- case 14:
- goto HeaderContentLocation;
- case 15:
- goto HeaderContentMD5;
- case 16:
- goto HeaderContentRange;
- case 17:
- goto HeaderExpires;
- case 18:
- goto HeaderLastModified;
- case 19:
- goto HeaderAccept;
- case 20:
- goto HeaderAcceptCharset;
- case 21:
- goto HeaderAcceptEncoding;
- case 22:
- goto HeaderAcceptLanguage;
- case 23:
- goto HeaderAuthorization;
- case 24:
- goto HeaderCookie;
- case 25:
- goto HeaderExpect;
- case 26:
- goto HeaderFrom;
- case 27:
- goto HeaderHost;
- case 28:
- goto HeaderIfMatch;
- case 29:
- goto HeaderIfModifiedSince;
- case 30:
- goto HeaderIfNoneMatch;
- case 31:
- goto HeaderIfRange;
- case 32:
- goto HeaderIfUnmodifiedSince;
- case 33:
- goto HeaderMaxForwards;
- case 34:
- goto HeaderProxyAuthorization;
- case 35:
- goto HeaderReferer;
- case 36:
- goto HeaderRange;
- case 37:
- goto HeaderTE;
- case 38:
- goto HeaderTranslate;
- case 39:
- goto HeaderUserAgent;
- case 40:
- goto HeaderDNT;
- case 41:
- goto HeaderUpgradeInsecureRequests;
- case 42:
- goto HeaderOrigin;
- case 43:
- goto HeaderAccessControlRequestMethod;
- case 44:
- goto HeaderAccessControlRequestHeaders;
- case 45:
- goto HeaderContentLength;
- default:
- goto ExtraHeaders;
- }
-
- HeaderCacheControl: // case 0
- if ((_bits & 0x1L) != 0)
+ if (ReferenceEquals(HeaderNames.Origin, key))
{
- _current = new KeyValuePair("Cache-Control", _collection._headers._CacheControl);
- _next = 1;
- return true;
+ if ((_bits & 0x400000000000L) != 0)
+ {
+ _bits &= ~0x400000000000L;
+ _headers._Origin = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderConnection: // case 1
- if ((_bits & 0x2L) != 0)
+
+ if (HeaderNames.Accept.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _current = new KeyValuePair("Connection", _collection._headers._Connection);
- _next = 2;
- return true;
+ if ((_bits & 0x80000L) != 0)
+ {
+ _bits &= ~0x80000L;
+ _headers._Accept = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderDate: // case 2
- if ((_bits & 0x4L) != 0)
+ if (HeaderNames.Pragma.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _current = new KeyValuePair("Date", _collection._headers._Date);
- _next = 3;
- return true;
+ if ((_bits & 0x10L) != 0)
+ {
+ _bits &= ~0x10L;
+ _headers._Pragma = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderKeepAlive: // case 3
- if ((_bits & 0x8L) != 0)
+ if (HeaderNames.Cookie.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _current = new KeyValuePair("Keep-Alive", _collection._headers._KeepAlive);
- _next = 4;
- return true;
+ if ((_bits & 0x1000000L) != 0)
+ {
+ _bits &= ~0x1000000L;
+ _headers._Cookie = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderPragma: // case 4
- if ((_bits & 0x10L) != 0)
+ if (HeaderNames.Expect.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _current = new KeyValuePair("Pragma", _collection._headers._Pragma);
- _next = 5;
- return true;
+ if ((_bits & 0x2000000L) != 0)
+ {
+ _bits &= ~0x2000000L;
+ _headers._Expect = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderTrailer: // case 5
- if ((_bits & 0x20L) != 0)
+ if (HeaderNames.Origin.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _current = new KeyValuePair("Trailer", _collection._headers._Trailer);
- _next = 6;
- return true;
+ if ((_bits & 0x400000000000L) != 0)
+ {
+ _bits &= ~0x400000000000L;
+ _headers._Origin = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderTransferEncoding: // case 6
- if ((_bits & 0x40L) != 0)
+ break;
+ }
+ case 7:
+ {
+ if (ReferenceEquals(HeaderNames.Trailer, key))
{
- _current = new KeyValuePair("Transfer-Encoding", _collection._headers._TransferEncoding);
- _next = 7;
- return true;
+ if ((_bits & 0x20L) != 0)
+ {
+ _bits &= ~0x20L;
+ _headers._Trailer = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderUpgrade: // case 7
- if ((_bits & 0x80L) != 0)
+ if (ReferenceEquals(HeaderNames.Upgrade, key))
{
- _current = new KeyValuePair("Upgrade", _collection._headers._Upgrade);
- _next = 8;
- return true;
- }
- HeaderVia: // case 8
- if ((_bits & 0x100L) != 0)
- {
- _current = new KeyValuePair("Via", _collection._headers._Via);
- _next = 9;
- return true;
+ if ((_bits & 0x80L) != 0)
+ {
+ _bits &= ~0x80L;
+ _headers._Upgrade = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderWarning: // case 9
- if ((_bits & 0x200L) != 0)
+ if (ReferenceEquals(HeaderNames.Warning, key))
{
- _current = new KeyValuePair("Warning", _collection._headers._Warning);
- _next = 10;
- return true;
+ if ((_bits & 0x200L) != 0)
+ {
+ _bits &= ~0x200L;
+ _headers._Warning = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderAllow: // case 10
- if ((_bits & 0x400L) != 0)
+ if (ReferenceEquals(HeaderNames.Expires, key))
{
- _current = new KeyValuePair("Allow", _collection._headers._Allow);
- _next = 11;
- return true;
+ if ((_bits & 0x20000L) != 0)
+ {
+ _bits &= ~0x20000L;
+ _headers._Expires = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderContentType: // case 11
- if ((_bits & 0x800L) != 0)
+ if (ReferenceEquals(HeaderNames.Referer, key))
{
- _current = new KeyValuePair("Content-Type", _collection._headers._ContentType);
- _next = 12;
- return true;
+ if ((_bits & 0x800000000L) != 0)
+ {
+ _bits &= ~0x800000000L;
+ _headers._Referer = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderContentEncoding: // case 12
- if ((_bits & 0x1000L) != 0)
+
+ if (HeaderNames.Trailer.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _current = new KeyValuePair("Content-Encoding", _collection._headers._ContentEncoding);
- _next = 13;
- return true;
+ if ((_bits & 0x20L) != 0)
+ {
+ _bits &= ~0x20L;
+ _headers._Trailer = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderContentLanguage: // case 13
- if ((_bits & 0x2000L) != 0)
+ if (HeaderNames.Upgrade.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _current = new KeyValuePair("Content-Language", _collection._headers._ContentLanguage);
- _next = 14;
- return true;
+ if ((_bits & 0x80L) != 0)
+ {
+ _bits &= ~0x80L;
+ _headers._Upgrade = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderContentLocation: // case 14
- if ((_bits & 0x4000L) != 0)
+ if (HeaderNames.Warning.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _current = new KeyValuePair("Content-Location", _collection._headers._ContentLocation);
- _next = 15;
- return true;
+ if ((_bits & 0x200L) != 0)
+ {
+ _bits &= ~0x200L;
+ _headers._Warning = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderContentMD5: // case 15
- if ((_bits & 0x8000L) != 0)
+ if (HeaderNames.Expires.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _current = new KeyValuePair("Content-MD5", _collection._headers._ContentMD5);
- _next = 16;
- return true;
+ if ((_bits & 0x20000L) != 0)
+ {
+ _bits &= ~0x20000L;
+ _headers._Expires = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderContentRange: // case 16
- if ((_bits & 0x10000L) != 0)
+ if (HeaderNames.Referer.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _current = new KeyValuePair("Content-Range", _collection._headers._ContentRange);
- _next = 17;
- return true;
+ if ((_bits & 0x800000000L) != 0)
+ {
+ _bits &= ~0x800000000L;
+ _headers._Referer = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderExpires: // case 17
- if ((_bits & 0x20000L) != 0)
+ break;
+ }
+ case 8:
+ {
+ if (ReferenceEquals(HeaderNames.IfMatch, key))
{
- _current = new KeyValuePair("Expires", _collection._headers._Expires);
- _next = 18;
- return true;
+ if ((_bits & 0x10000000L) != 0)
+ {
+ _bits &= ~0x10000000L;
+ _headers._IfMatch = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderLastModified: // case 18
- if ((_bits & 0x40000L) != 0)
+ if (ReferenceEquals(HeaderNames.IfRange, key))
{
- _current = new KeyValuePair("Last-Modified", _collection._headers._LastModified);
- _next = 19;
- return true;
+ if ((_bits & 0x80000000L) != 0)
+ {
+ _bits &= ~0x80000000L;
+ _headers._IfRange = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderAccept: // case 19
- if ((_bits & 0x80000L) != 0)
+
+ if (HeaderNames.IfMatch.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _current = new KeyValuePair("Accept", _collection._headers._Accept);
- _next = 20;
- return true;
+ if ((_bits & 0x10000000L) != 0)
+ {
+ _bits &= ~0x10000000L;
+ _headers._IfMatch = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderAcceptCharset: // case 20
- if ((_bits & 0x100000L) != 0)
+ if (HeaderNames.IfRange.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _current = new KeyValuePair("Accept-Charset", _collection._headers._AcceptCharset);
- _next = 21;
- return true;
+ if ((_bits & 0x80000000L) != 0)
+ {
+ _bits &= ~0x80000000L;
+ _headers._IfRange = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderAcceptEncoding: // case 21
- if ((_bits & 0x200000L) != 0)
+ break;
+ }
+ case 9:
+ {
+ if (ReferenceEquals(HeaderNames.Translate, key))
{
- _current = new KeyValuePair("Accept-Encoding", _collection._headers._AcceptEncoding);
- _next = 22;
- return true;
+ if ((_bits & 0x4000000000L) != 0)
+ {
+ _bits &= ~0x4000000000L;
+ _headers._Translate = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderAcceptLanguage: // case 22
- if ((_bits & 0x400000L) != 0)
+
+ if (HeaderNames.Translate.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _current = new KeyValuePair("Accept-Language", _collection._headers._AcceptLanguage);
- _next = 23;
- return true;
+ if ((_bits & 0x4000000000L) != 0)
+ {
+ _bits &= ~0x4000000000L;
+ _headers._Translate = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderAuthorization: // case 23
- if ((_bits & 0x800000L) != 0)
+ break;
+ }
+ case 10:
+ {
+ if (ReferenceEquals(HeaderNames.Connection, key))
{
- _current = new KeyValuePair("Authorization", _collection._headers._Authorization);
- _next = 24;
- return true;
+ if ((_bits & 0x2L) != 0)
+ {
+ _bits &= ~0x2L;
+ _headers._Connection = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderCookie: // case 24
- if ((_bits & 0x1000000L) != 0)
+ if (ReferenceEquals(HeaderNames.UserAgent, key))
{
- _current = new KeyValuePair("Cookie", _collection._headers._Cookie);
- _next = 25;
- return true;
+ if ((_bits & 0x8000000000L) != 0)
+ {
+ _bits &= ~0x8000000000L;
+ _headers._UserAgent = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderExpect: // case 25
- if ((_bits & 0x2000000L) != 0)
+ if (ReferenceEquals(HeaderNames.KeepAlive, key))
{
- _current = new KeyValuePair("Expect", _collection._headers._Expect);
- _next = 26;
- return true;
+ if ((_bits & 0x8L) != 0)
+ {
+ _bits &= ~0x8L;
+ _headers._KeepAlive = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderFrom: // case 26
- if ((_bits & 0x4000000L) != 0)
+ if (ReferenceEquals(HeaderNames.RequestId, key))
{
- _current = new KeyValuePair("From", _collection._headers._From);
- _next = 27;
- return true;
+ if ((_bits & 0x40000000000L) != 0)
+ {
+ _bits &= ~0x40000000000L;
+ _headers._RequestId = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderHost: // case 27
- if ((_bits & 0x8000000L) != 0)
+ if (ReferenceEquals(HeaderNames.TraceState, key))
{
- _current = new KeyValuePair("Host", _collection._headers._Host);
- _next = 28;
- return true;
+ if ((_bits & 0x200000000000L) != 0)
+ {
+ _bits &= ~0x200000000000L;
+ _headers._TraceState = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderIfMatch: // case 28
- if ((_bits & 0x10000000L) != 0)
+
+ if (HeaderNames.Connection.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _current = new KeyValuePair("If-Match", _collection._headers._IfMatch);
- _next = 29;
- return true;
+ if ((_bits & 0x2L) != 0)
+ {
+ _bits &= ~0x2L;
+ _headers._Connection = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderIfModifiedSince: // case 29
- if ((_bits & 0x20000000L) != 0)
+ if (HeaderNames.UserAgent.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _current = new KeyValuePair("If-Modified-Since", _collection._headers._IfModifiedSince);
- _next = 30;
- return true;
+ if ((_bits & 0x8000000000L) != 0)
+ {
+ _bits &= ~0x8000000000L;
+ _headers._UserAgent = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderIfNoneMatch: // case 30
- if ((_bits & 0x40000000L) != 0)
+ if (HeaderNames.KeepAlive.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _current = new KeyValuePair("If-None-Match", _collection._headers._IfNoneMatch);
- _next = 31;
- return true;
+ if ((_bits & 0x8L) != 0)
+ {
+ _bits &= ~0x8L;
+ _headers._KeepAlive = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderIfRange: // case 31
- if ((_bits & 0x80000000L) != 0)
+ if (HeaderNames.RequestId.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _current = new KeyValuePair("If-Range", _collection._headers._IfRange);
- _next = 32;
- return true;
+ if ((_bits & 0x40000000000L) != 0)
+ {
+ _bits &= ~0x40000000000L;
+ _headers._RequestId = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderIfUnmodifiedSince: // case 32
- if ((_bits & 0x100000000L) != 0)
+ if (HeaderNames.TraceState.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _current = new KeyValuePair("If-Unmodified-Since", _collection._headers._IfUnmodifiedSince);
- _next = 33;
- return true;
+ if ((_bits & 0x200000000000L) != 0)
+ {
+ _bits &= ~0x200000000000L;
+ _headers._TraceState = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderMaxForwards: // case 33
- if ((_bits & 0x200000000L) != 0)
+ break;
+ }
+ case 11:
+ {
+ if (ReferenceEquals(HeaderNames.ContentMD5, key))
{
- _current = new KeyValuePair("Max-Forwards", _collection._headers._MaxForwards);
- _next = 34;
- return true;
+ if ((_bits & 0x8000L) != 0)
+ {
+ _bits &= ~0x8000L;
+ _headers._ContentMD5 = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderProxyAuthorization: // case 34
- if ((_bits & 0x400000000L) != 0)
+ if (ReferenceEquals(HeaderNames.TraceParent, key))
{
- _current = new KeyValuePair("Proxy-Authorization", _collection._headers._ProxyAuthorization);
- _next = 35;
- return true;
+ if ((_bits & 0x100000000000L) != 0)
+ {
+ _bits &= ~0x100000000000L;
+ _headers._TraceParent = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderReferer: // case 35
- if ((_bits & 0x800000000L) != 0)
+
+ if (HeaderNames.ContentMD5.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _current = new KeyValuePair("Referer", _collection._headers._Referer);
- _next = 36;
- return true;
+ if ((_bits & 0x8000L) != 0)
+ {
+ _bits &= ~0x8000L;
+ _headers._ContentMD5 = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderRange: // case 36
- if ((_bits & 0x1000000000L) != 0)
+ if (HeaderNames.TraceParent.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _current = new KeyValuePair("Range", _collection._headers._Range);
- _next = 37;
- return true;
+ if ((_bits & 0x100000000000L) != 0)
+ {
+ _bits &= ~0x100000000000L;
+ _headers._TraceParent = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderTE: // case 37
- if ((_bits & 0x2000000000L) != 0)
+ break;
+ }
+ case 12:
+ {
+ if (ReferenceEquals(HeaderNames.ContentType, key))
{
- _current = new KeyValuePair("TE", _collection._headers._TE);
- _next = 38;
- return true;
+ if ((_bits & 0x800L) != 0)
+ {
+ _bits &= ~0x800L;
+ _headers._ContentType = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderTranslate: // case 38
- if ((_bits & 0x4000000000L) != 0)
+ if (ReferenceEquals(HeaderNames.MaxForwards, key))
{
- _current = new KeyValuePair("Translate", _collection._headers._Translate);
- _next = 39;
- return true;
+ if ((_bits & 0x200000000L) != 0)
+ {
+ _bits &= ~0x200000000L;
+ _headers._MaxForwards = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderUserAgent: // case 39
- if ((_bits & 0x8000000000L) != 0)
+
+ if (HeaderNames.ContentType.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _current = new KeyValuePair("User-Agent", _collection._headers._UserAgent);
- _next = 40;
- return true;
+ if ((_bits & 0x800L) != 0)
+ {
+ _bits &= ~0x800L;
+ _headers._ContentType = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderDNT: // case 40
- if ((_bits & 0x10000000000L) != 0)
+ if (HeaderNames.MaxForwards.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _current = new KeyValuePair("DNT", _collection._headers._DNT);
- _next = 41;
- return true;
+ if ((_bits & 0x200000000L) != 0)
+ {
+ _bits &= ~0x200000000L;
+ _headers._MaxForwards = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderUpgradeInsecureRequests: // case 41
- if ((_bits & 0x20000000000L) != 0)
- {
- _current = new KeyValuePair("Upgrade-Insecure-Requests", _collection._headers._UpgradeInsecureRequests);
- _next = 42;
- return true;
+ break;
+ }
+ case 13:
+ {
+ if (ReferenceEquals(HeaderNames.CacheControl, key))
+ {
+ if ((_bits & 0x1L) != 0)
+ {
+ _bits &= ~0x1L;
+ _headers._CacheControl = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderOrigin: // case 42
- if ((_bits & 0x40000000000L) != 0)
+ if (ReferenceEquals(HeaderNames.ContentRange, key))
{
- _current = new KeyValuePair("Origin", _collection._headers._Origin);
- _next = 43;
- return true;
+ if ((_bits & 0x10000L) != 0)
+ {
+ _bits &= ~0x10000L;
+ _headers._ContentRange = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderAccessControlRequestMethod: // case 43
- if ((_bits & 0x80000000000L) != 0)
+ if (ReferenceEquals(HeaderNames.LastModified, key))
{
- _current = new KeyValuePair("Access-Control-Request-Method", _collection._headers._AccessControlRequestMethod);
- _next = 44;
- return true;
+ if ((_bits & 0x40000L) != 0)
+ {
+ _bits &= ~0x40000L;
+ _headers._LastModified = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderAccessControlRequestHeaders: // case 44
- if ((_bits & 0x100000000000L) != 0)
+ if (ReferenceEquals(HeaderNames.Authorization, key))
{
- _current = new KeyValuePair("Access-Control-Request-Headers", _collection._headers._AccessControlRequestHeaders);
- _next = 45;
- return true;
+ if ((_bits & 0x800000L) != 0)
+ {
+ _bits &= ~0x800000L;
+ _headers._Authorization = default(StringValues);
+ return true;
+ }
+ return false;
}
- HeaderContentLength: // case 45
- if (_collection._contentLength.HasValue)
+ if (ReferenceEquals(HeaderNames.IfNoneMatch, key))
{
- _current = new KeyValuePair("Content-Length", HeaderUtilities.FormatNonNegativeInt64(_collection._contentLength.Value));
- _next = 46;
- return true;
+ if ((_bits & 0x40000000L) != 0)
+ {
+ _bits &= ~0x40000000L;
+ _headers._IfNoneMatch = default(StringValues);
+ return true;
+ }
+ return false;
}
- ExtraHeaders:
- if (!_hasUnknown || !_unknownEnumerator.MoveNext())
+
+ if (HeaderNames.CacheControl.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _current = default(KeyValuePair);
+ if ((_bits & 0x1L) != 0)
+ {
+ _bits &= ~0x1L;
+ _headers._CacheControl = default(StringValues);
+ return true;
+ }
return false;
}
- _current = _unknownEnumerator.Current;
- return true;
+ if (HeaderNames.ContentRange.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x10000L) != 0)
+ {
+ _bits &= ~0x10000L;
+ _headers._ContentRange = default(StringValues);
+ return true;
+ }
+ return false;
+ }
+ if (HeaderNames.LastModified.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x40000L) != 0)
+ {
+ _bits &= ~0x40000L;
+ _headers._LastModified = default(StringValues);
+ return true;
+ }
+ return false;
+ }
+ if (HeaderNames.Authorization.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x800000L) != 0)
+ {
+ _bits &= ~0x800000L;
+ _headers._Authorization = default(StringValues);
+ return true;
+ }
+ return false;
+ }
+ if (HeaderNames.IfNoneMatch.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x40000000L) != 0)
+ {
+ _bits &= ~0x40000000L;
+ _headers._IfNoneMatch = default(StringValues);
+ return true;
+ }
+ return false;
+ }
+ break;
+ }
+ case 14:
+ {
+ if (ReferenceEquals(HeaderNames.AcceptCharset, key))
+ {
+ if ((_bits & 0x100000L) != 0)
+ {
+ _bits &= ~0x100000L;
+ _headers._AcceptCharset = default(StringValues);
+ return true;
+ }
+ return false;
+ }
+ if (ReferenceEquals(HeaderNames.ContentLength, key))
+ {
+ if (_contentLength.HasValue)
+ {
+ _contentLength = null;
+ return true;
+ }
+ return false;
+ }
+
+ if (HeaderNames.AcceptCharset.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x100000L) != 0)
+ {
+ _bits &= ~0x100000L;
+ _headers._AcceptCharset = default(StringValues);
+ return true;
+ }
+ return false;
+ }
+ if (HeaderNames.ContentLength.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if (_contentLength.HasValue)
+ {
+ _contentLength = null;
+ return true;
+ }
+ return false;
+ }
+ break;
+ }
+ case 15:
+ {
+ if (ReferenceEquals(HeaderNames.AcceptEncoding, key))
+ {
+ if ((_bits & 0x200000L) != 0)
+ {
+ _bits &= ~0x200000L;
+ _headers._AcceptEncoding = default(StringValues);
+ return true;
+ }
+ return false;
+ }
+ if (ReferenceEquals(HeaderNames.AcceptLanguage, key))
+ {
+ if ((_bits & 0x400000L) != 0)
+ {
+ _bits &= ~0x400000L;
+ _headers._AcceptLanguage = default(StringValues);
+ return true;
+ }
+ return false;
+ }
+
+ if (HeaderNames.AcceptEncoding.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x200000L) != 0)
+ {
+ _bits &= ~0x200000L;
+ _headers._AcceptEncoding = default(StringValues);
+ return true;
+ }
+ return false;
+ }
+ if (HeaderNames.AcceptLanguage.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x400000L) != 0)
+ {
+ _bits &= ~0x400000L;
+ _headers._AcceptLanguage = default(StringValues);
+ return true;
+ }
+ return false;
+ }
+ break;
+ }
+ case 16:
+ {
+ if (ReferenceEquals(HeaderNames.ContentEncoding, key))
+ {
+ if ((_bits & 0x1000L) != 0)
+ {
+ _bits &= ~0x1000L;
+ _headers._ContentEncoding = default(StringValues);
+ return true;
+ }
+ return false;
+ }
+ if (ReferenceEquals(HeaderNames.ContentLanguage, key))
+ {
+ if ((_bits & 0x2000L) != 0)
+ {
+ _bits &= ~0x2000L;
+ _headers._ContentLanguage = default(StringValues);
+ return true;
+ }
+ return false;
+ }
+ if (ReferenceEquals(HeaderNames.ContentLocation, key))
+ {
+ if ((_bits & 0x4000L) != 0)
+ {
+ _bits &= ~0x4000L;
+ _headers._ContentLocation = default(StringValues);
+ return true;
+ }
+ return false;
+ }
+
+ if (HeaderNames.ContentEncoding.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x1000L) != 0)
+ {
+ _bits &= ~0x1000L;
+ _headers._ContentEncoding = default(StringValues);
+ return true;
+ }
+ return false;
+ }
+ if (HeaderNames.ContentLanguage.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x2000L) != 0)
+ {
+ _bits &= ~0x2000L;
+ _headers._ContentLanguage = default(StringValues);
+ return true;
+ }
+ return false;
+ }
+ if (HeaderNames.ContentLocation.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x4000L) != 0)
+ {
+ _bits &= ~0x4000L;
+ _headers._ContentLocation = default(StringValues);
+ return true;
+ }
+ return false;
+ }
+ break;
+ }
+ case 17:
+ {
+ if (ReferenceEquals(HeaderNames.TransferEncoding, key))
+ {
+ if ((_bits & 0x40L) != 0)
+ {
+ _bits &= ~0x40L;
+ _headers._TransferEncoding = default(StringValues);
+ return true;
+ }
+ return false;
+ }
+ if (ReferenceEquals(HeaderNames.IfModifiedSince, key))
+ {
+ if ((_bits & 0x20000000L) != 0)
+ {
+ _bits &= ~0x20000000L;
+ _headers._IfModifiedSince = default(StringValues);
+ return true;
+ }
+ return false;
+ }
+
+ if (HeaderNames.TransferEncoding.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x40L) != 0)
+ {
+ _bits &= ~0x40L;
+ _headers._TransferEncoding = default(StringValues);
+ return true;
+ }
+ return false;
+ }
+ if (HeaderNames.IfModifiedSince.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x20000000L) != 0)
+ {
+ _bits &= ~0x20000000L;
+ _headers._IfModifiedSince = default(StringValues);
+ return true;
+ }
+ return false;
+ }
+ break;
+ }
+ case 19:
+ {
+ if (ReferenceEquals(HeaderNames.IfUnmodifiedSince, key))
+ {
+ if ((_bits & 0x100000000L) != 0)
+ {
+ _bits &= ~0x100000000L;
+ _headers._IfUnmodifiedSince = default(StringValues);
+ return true;
+ }
+ return false;
+ }
+ if (ReferenceEquals(HeaderNames.ProxyAuthorization, key))
+ {
+ if ((_bits & 0x400000000L) != 0)
+ {
+ _bits &= ~0x400000000L;
+ _headers._ProxyAuthorization = default(StringValues);
+ return true;
+ }
+ return false;
+ }
+ if (ReferenceEquals(HeaderNames.CorrelationContext, key))
+ {
+ if ((_bits & 0x80000000000L) != 0)
+ {
+ _bits &= ~0x80000000000L;
+ _headers._CorrelationContext = default(StringValues);
+ return true;
+ }
+ return false;
+ }
+
+ if (HeaderNames.IfUnmodifiedSince.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x100000000L) != 0)
+ {
+ _bits &= ~0x100000000L;
+ _headers._IfUnmodifiedSince = default(StringValues);
+ return true;
+ }
+ return false;
+ }
+ if (HeaderNames.ProxyAuthorization.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x400000000L) != 0)
+ {
+ _bits &= ~0x400000000L;
+ _headers._ProxyAuthorization = default(StringValues);
+ return true;
+ }
+ return false;
+ }
+ if (HeaderNames.CorrelationContext.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x80000000000L) != 0)
+ {
+ _bits &= ~0x80000000000L;
+ _headers._CorrelationContext = default(StringValues);
+ return true;
+ }
+ return false;
+ }
+ break;
+ }
+ case 25:
+ {
+ if (ReferenceEquals(HeaderNames.UpgradeInsecureRequests, key))
+ {
+ if ((_bits & 0x20000000000L) != 0)
+ {
+ _bits &= ~0x20000000000L;
+ _headers._UpgradeInsecureRequests = default(StringValues);
+ return true;
+ }
+ return false;
+ }
+
+ if (HeaderNames.UpgradeInsecureRequests.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x20000000000L) != 0)
+ {
+ _bits &= ~0x20000000000L;
+ _headers._UpgradeInsecureRequests = default(StringValues);
+ return true;
+ }
+ return false;
+ }
+ break;
+ }
+ case 29:
+ {
+ if (ReferenceEquals(HeaderNames.AccessControlRequestMethod, key))
+ {
+ if ((_bits & 0x800000000000L) != 0)
+ {
+ _bits &= ~0x800000000000L;
+ _headers._AccessControlRequestMethod = default(StringValues);
+ return true;
+ }
+ return false;
+ }
+
+ if (HeaderNames.AccessControlRequestMethod.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x800000000000L) != 0)
+ {
+ _bits &= ~0x800000000000L;
+ _headers._AccessControlRequestMethod = default(StringValues);
+ return true;
+ }
+ return false;
+ }
+ break;
+ }
+ case 30:
+ {
+ if (ReferenceEquals(HeaderNames.AccessControlRequestHeaders, key))
+ {
+ if ((_bits & 0x1000000000000L) != 0)
+ {
+ _bits &= ~0x1000000000000L;
+ _headers._AccessControlRequestHeaders = default(StringValues);
+ return true;
+ }
+ return false;
+ }
+
+ if (HeaderNames.AccessControlRequestHeaders.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x1000000000000L) != 0)
+ {
+ _bits &= ~0x1000000000000L;
+ _headers._AccessControlRequestHeaders = default(StringValues);
+ return true;
+ }
+ return false;
+ }
+ break;
+ }
+ }
+
+ return RemoveUnknown(key);
+ }
+ private void Clear(long bitsToClear)
+ {
+ var tempBits = bitsToClear;
+
+ if ((tempBits & 0x2L) != 0)
+ {
+ _headers._Connection = default;
+ if((tempBits & ~0x2L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x2L;
+ }
+
+ if ((tempBits & 0x80000L) != 0)
+ {
+ _headers._Accept = default;
+ if((tempBits & ~0x80000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x80000L;
+ }
+
+ if ((tempBits & 0x8000000L) != 0)
+ {
+ _headers._Host = default;
+ if((tempBits & ~0x8000000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x8000000L;
+ }
+
+ if ((tempBits & 0x8000000000L) != 0)
+ {
+ _headers._UserAgent = default;
+ if((tempBits & ~0x8000000000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x8000000000L;
+ }
+
+ if ((tempBits & 0x1L) != 0)
+ {
+ _headers._CacheControl = default;
+ if((tempBits & ~0x1L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x1L;
+ }
+
+ if ((tempBits & 0x4L) != 0)
+ {
+ _headers._Date = default;
+ if((tempBits & ~0x4L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x4L;
+ }
+
+ if ((tempBits & 0x8L) != 0)
+ {
+ _headers._KeepAlive = default;
+ if((tempBits & ~0x8L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x8L;
+ }
+
+ if ((tempBits & 0x10L) != 0)
+ {
+ _headers._Pragma = default;
+ if((tempBits & ~0x10L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x10L;
+ }
+
+ if ((tempBits & 0x20L) != 0)
+ {
+ _headers._Trailer = default;
+ if((tempBits & ~0x20L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x20L;
+ }
+
+ if ((tempBits & 0x40L) != 0)
+ {
+ _headers._TransferEncoding = default;
+ if((tempBits & ~0x40L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x40L;
+ }
+
+ if ((tempBits & 0x80L) != 0)
+ {
+ _headers._Upgrade = default;
+ if((tempBits & ~0x80L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x80L;
+ }
+
+ if ((tempBits & 0x100L) != 0)
+ {
+ _headers._Via = default;
+ if((tempBits & ~0x100L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x100L;
+ }
+
+ if ((tempBits & 0x200L) != 0)
+ {
+ _headers._Warning = default;
+ if((tempBits & ~0x200L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x200L;
+ }
+
+ if ((tempBits & 0x400L) != 0)
+ {
+ _headers._Allow = default;
+ if((tempBits & ~0x400L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x400L;
+ }
+
+ if ((tempBits & 0x800L) != 0)
+ {
+ _headers._ContentType = default;
+ if((tempBits & ~0x800L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x800L;
+ }
+
+ if ((tempBits & 0x1000L) != 0)
+ {
+ _headers._ContentEncoding = default;
+ if((tempBits & ~0x1000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x1000L;
+ }
+
+ if ((tempBits & 0x2000L) != 0)
+ {
+ _headers._ContentLanguage = default;
+ if((tempBits & ~0x2000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x2000L;
+ }
+
+ if ((tempBits & 0x4000L) != 0)
+ {
+ _headers._ContentLocation = default;
+ if((tempBits & ~0x4000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x4000L;
+ }
+
+ if ((tempBits & 0x8000L) != 0)
+ {
+ _headers._ContentMD5 = default;
+ if((tempBits & ~0x8000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x8000L;
+ }
+
+ if ((tempBits & 0x10000L) != 0)
+ {
+ _headers._ContentRange = default;
+ if((tempBits & ~0x10000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x10000L;
+ }
+
+ if ((tempBits & 0x20000L) != 0)
+ {
+ _headers._Expires = default;
+ if((tempBits & ~0x20000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x20000L;
+ }
+
+ if ((tempBits & 0x40000L) != 0)
+ {
+ _headers._LastModified = default;
+ if((tempBits & ~0x40000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x40000L;
+ }
+
+ if ((tempBits & 0x100000L) != 0)
+ {
+ _headers._AcceptCharset = default;
+ if((tempBits & ~0x100000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x100000L;
+ }
+
+ if ((tempBits & 0x200000L) != 0)
+ {
+ _headers._AcceptEncoding = default;
+ if((tempBits & ~0x200000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x200000L;
+ }
+
+ if ((tempBits & 0x400000L) != 0)
+ {
+ _headers._AcceptLanguage = default;
+ if((tempBits & ~0x400000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x400000L;
+ }
+
+ if ((tempBits & 0x800000L) != 0)
+ {
+ _headers._Authorization = default;
+ if((tempBits & ~0x800000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x800000L;
+ }
+
+ if ((tempBits & 0x1000000L) != 0)
+ {
+ _headers._Cookie = default;
+ if((tempBits & ~0x1000000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x1000000L;
+ }
+
+ if ((tempBits & 0x2000000L) != 0)
+ {
+ _headers._Expect = default;
+ if((tempBits & ~0x2000000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x2000000L;
+ }
+
+ if ((tempBits & 0x4000000L) != 0)
+ {
+ _headers._From = default;
+ if((tempBits & ~0x4000000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x4000000L;
+ }
+
+ if ((tempBits & 0x10000000L) != 0)
+ {
+ _headers._IfMatch = default;
+ if((tempBits & ~0x10000000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x10000000L;
+ }
+
+ if ((tempBits & 0x20000000L) != 0)
+ {
+ _headers._IfModifiedSince = default;
+ if((tempBits & ~0x20000000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x20000000L;
+ }
+
+ if ((tempBits & 0x40000000L) != 0)
+ {
+ _headers._IfNoneMatch = default;
+ if((tempBits & ~0x40000000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x40000000L;
+ }
+
+ if ((tempBits & 0x80000000L) != 0)
+ {
+ _headers._IfRange = default;
+ if((tempBits & ~0x80000000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x80000000L;
+ }
+
+ if ((tempBits & 0x100000000L) != 0)
+ {
+ _headers._IfUnmodifiedSince = default;
+ if((tempBits & ~0x100000000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x100000000L;
+ }
+
+ if ((tempBits & 0x200000000L) != 0)
+ {
+ _headers._MaxForwards = default;
+ if((tempBits & ~0x200000000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x200000000L;
+ }
+
+ if ((tempBits & 0x400000000L) != 0)
+ {
+ _headers._ProxyAuthorization = default;
+ if((tempBits & ~0x400000000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x400000000L;
+ }
+
+ if ((tempBits & 0x800000000L) != 0)
+ {
+ _headers._Referer = default;
+ if((tempBits & ~0x800000000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x800000000L;
+ }
+
+ if ((tempBits & 0x1000000000L) != 0)
+ {
+ _headers._Range = default;
+ if((tempBits & ~0x1000000000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x1000000000L;
+ }
+
+ if ((tempBits & 0x2000000000L) != 0)
+ {
+ _headers._TE = default;
+ if((tempBits & ~0x2000000000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x2000000000L;
+ }
+
+ if ((tempBits & 0x4000000000L) != 0)
+ {
+ _headers._Translate = default;
+ if((tempBits & ~0x4000000000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x4000000000L;
+ }
+
+ if ((tempBits & 0x10000000000L) != 0)
+ {
+ _headers._DNT = default;
+ if((tempBits & ~0x10000000000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x10000000000L;
+ }
+
+ if ((tempBits & 0x20000000000L) != 0)
+ {
+ _headers._UpgradeInsecureRequests = default;
+ if((tempBits & ~0x20000000000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x20000000000L;
+ }
+
+ if ((tempBits & 0x40000000000L) != 0)
+ {
+ _headers._RequestId = default;
+ if((tempBits & ~0x40000000000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x40000000000L;
+ }
+
+ if ((tempBits & 0x80000000000L) != 0)
+ {
+ _headers._CorrelationContext = default;
+ if((tempBits & ~0x80000000000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x80000000000L;
+ }
+
+ if ((tempBits & 0x100000000000L) != 0)
+ {
+ _headers._TraceParent = default;
+ if((tempBits & ~0x100000000000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x100000000000L;
+ }
+
+ if ((tempBits & 0x200000000000L) != 0)
+ {
+ _headers._TraceState = default;
+ if((tempBits & ~0x200000000000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x200000000000L;
+ }
+
+ if ((tempBits & 0x400000000000L) != 0)
+ {
+ _headers._Origin = default;
+ if((tempBits & ~0x400000000000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x400000000000L;
+ }
+
+ if ((tempBits & 0x800000000000L) != 0)
+ {
+ _headers._AccessControlRequestMethod = default;
+ if((tempBits & ~0x800000000000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x800000000000L;
+ }
+
+ if ((tempBits & 0x1000000000000L) != 0)
+ {
+ _headers._AccessControlRequestHeaders = default;
+ if((tempBits & ~0x1000000000000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x1000000000000L;
+ }
+
+ }
+
+ protected override bool CopyToFast(KeyValuePair[] array, int arrayIndex)
+ {
+ if (arrayIndex < 0)
+ {
+ return false;
+ }
+
+ if ((_bits & 0x1L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.CacheControl, _headers._CacheControl);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x2L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.Connection, _headers._Connection);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x4L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.Date, _headers._Date);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x8L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.KeepAlive, _headers._KeepAlive);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x10L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.Pragma, _headers._Pragma);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x20L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.Trailer, _headers._Trailer);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x40L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.TransferEncoding, _headers._TransferEncoding);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x80L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.Upgrade, _headers._Upgrade);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x100L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.Via, _headers._Via);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x200L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.Warning, _headers._Warning);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x400L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.Allow, _headers._Allow);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x800L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.ContentType, _headers._ContentType);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x1000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.ContentEncoding, _headers._ContentEncoding);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x2000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.ContentLanguage, _headers._ContentLanguage);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x4000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.ContentLocation, _headers._ContentLocation);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x8000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.ContentMD5, _headers._ContentMD5);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x10000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.ContentRange, _headers._ContentRange);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x20000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.Expires, _headers._Expires);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x40000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.LastModified, _headers._LastModified);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x80000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.Accept, _headers._Accept);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x100000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.AcceptCharset, _headers._AcceptCharset);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x200000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.AcceptEncoding, _headers._AcceptEncoding);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x400000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.AcceptLanguage, _headers._AcceptLanguage);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x800000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.Authorization, _headers._Authorization);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x1000000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.Cookie, _headers._Cookie);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x2000000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.Expect, _headers._Expect);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x4000000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.From, _headers._From);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x8000000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.Host, _headers._Host);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x10000000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.IfMatch, _headers._IfMatch);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x20000000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.IfModifiedSince, _headers._IfModifiedSince);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x40000000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.IfNoneMatch, _headers._IfNoneMatch);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x80000000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.IfRange, _headers._IfRange);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x100000000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.IfUnmodifiedSince, _headers._IfUnmodifiedSince);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x200000000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.MaxForwards, _headers._MaxForwards);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x400000000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.ProxyAuthorization, _headers._ProxyAuthorization);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x800000000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.Referer, _headers._Referer);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x1000000000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.Range, _headers._Range);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x2000000000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.TE, _headers._TE);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x4000000000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.Translate, _headers._Translate);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x8000000000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.UserAgent, _headers._UserAgent);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x10000000000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.DNT, _headers._DNT);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x20000000000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.UpgradeInsecureRequests, _headers._UpgradeInsecureRequests);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x40000000000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.RequestId, _headers._RequestId);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x80000000000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.CorrelationContext, _headers._CorrelationContext);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x100000000000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.TraceParent, _headers._TraceParent);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x200000000000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.TraceState, _headers._TraceState);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x400000000000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.Origin, _headers._Origin);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x800000000000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.AccessControlRequestMethod, _headers._AccessControlRequestMethod);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x1000000000000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.AccessControlRequestHeaders, _headers._AccessControlRequestHeaders);
+ ++arrayIndex;
+ }
+ if (_contentLength.HasValue)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
+ array[arrayIndex] = new KeyValuePair(HeaderNames.ContentLength, HeaderUtilities.FormatNonNegativeInt64(_contentLength.Value));
+ ++arrayIndex;
+ }
+ ((ICollection>)MaybeUnknown)?.CopyTo(array, arrayIndex);
+
+ return true;
+ }
+
+ [MethodImpl(MethodImplOptions.AggressiveOptimization)]
+ public unsafe void Append(Span name, Span value)
+ {
+ ref byte nameStart = ref MemoryMarshal.GetReference(name);
+ ref StringValues values = ref Unsafe.AsRef(null);
+ var flag = 0L;
+
+ // Does the name matched any "known" headers
+ switch (name.Length)
+ {
+ case 2:
+ if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfu) == 0x4554u))
+ {
+ flag = 0x2000000000L;
+ values = ref _headers._TE;
+ }
+ break;
+ case 3:
+ var firstTerm3 = (Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfu);
+ if ((firstTerm3 == 0x4e44u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)2) & 0xdfu) == 0x54u))
+ {
+ flag = 0x10000000000L;
+ values = ref _headers._DNT;
+ }
+ else if ((firstTerm3 == 0x4956u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)2) & 0xdfu) == 0x41u))
+ {
+ flag = 0x100L;
+ values = ref _headers._Via;
+ }
+ break;
+ case 4:
+ var firstTerm4 = (Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfu);
+ if ((firstTerm4 == 0x54534f48u))
+ {
+ flag = 0x8000000L;
+ values = ref _headers._Host;
+ }
+ else if ((firstTerm4 == 0x45544144u))
+ {
+ flag = 0x4L;
+ values = ref _headers._Date;
+ }
+ else if ((firstTerm4 == 0x4d4f5246u))
+ {
+ flag = 0x4000000L;
+ values = ref _headers._From;
+ }
+ break;
+ case 5:
+ var firstTerm5 = (Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfu);
+ if ((firstTerm5 == 0x4f4c4c41u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)4) & 0xdfu) == 0x57u))
+ {
+ flag = 0x400L;
+ values = ref _headers._Allow;
+ }
+ else if ((firstTerm5 == 0x474e4152u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)4) & 0xdfu) == 0x45u))
+ {
+ flag = 0x1000000000L;
+ values = ref _headers._Range;
+ }
+ break;
+ case 6:
+ var firstTerm6 = (Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfu);
+ if ((firstTerm6 == 0x45434341u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x5450u))
+ {
+ flag = 0x80000L;
+ values = ref _headers._Accept;
+ }
+ else if ((firstTerm6 == 0x4b4f4f43u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x4549u))
+ {
+ flag = 0x1000000L;
+ values = ref _headers._Cookie;
+ }
+ else if ((firstTerm6 == 0x45505845u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x5443u))
+ {
+ flag = 0x2000000L;
+ values = ref _headers._Expect;
+ }
+ else if ((firstTerm6 == 0x4749524fu) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x4e49u))
+ {
+ flag = 0x400000000000L;
+ values = ref _headers._Origin;
+ }
+ else if ((firstTerm6 == 0x47415250u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x414du))
+ {
+ flag = 0x10L;
+ values = ref _headers._Pragma;
+ }
+ break;
+ case 7:
+ var firstTerm7 = (Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfu);
+ if ((firstTerm7 == 0x49505845u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x4552u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)6) & 0xdfu) == 0x53u))
+ {
+ flag = 0x20000L;
+ values = ref _headers._Expires;
+ }
+ else if ((firstTerm7 == 0x45464552u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x4552u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)6) & 0xdfu) == 0x52u))
+ {
+ flag = 0x800000000L;
+ values = ref _headers._Referer;
+ }
+ else if ((firstTerm7 == 0x49415254u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x454cu) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)6) & 0xdfu) == 0x52u))
+ {
+ flag = 0x20L;
+ values = ref _headers._Trailer;
+ }
+ else if ((firstTerm7 == 0x52475055u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x4441u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)6) & 0xdfu) == 0x45u))
+ {
+ flag = 0x80L;
+ values = ref _headers._Upgrade;
+ }
+ else if ((firstTerm7 == 0x4e524157u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x4e49u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)6) & 0xdfu) == 0x47u))
+ {
+ flag = 0x200L;
+ values = ref _headers._Warning;
+ }
+ break;
+ case 8:
+ var firstTerm8 = (Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfdfffdfdfuL);
+ if ((firstTerm8 == 0x484354414d2d4649uL))
+ {
+ flag = 0x10000000L;
+ values = ref _headers._IfMatch;
+ }
+ else if ((firstTerm8 == 0x45474e41522d4649uL))
+ {
+ flag = 0x80000000L;
+ values = ref _headers._IfRange;
+ }
+ break;
+ case 9:
+ if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfdfdfdfdfuL) == 0x54414c534e415254uL) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)8) & 0xdfu) == 0x45u))
+ {
+ flag = 0x4000000000L;
+ values = ref _headers._Translate;
+ }
+ break;
+ case 10:
+ if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfdfdfdfdfuL) == 0x495443454e4e4f43uL) && ((Unsafe.ReadUnaligned