private static HashSet <string> CreateInvalidHeaders() { var invalidHeaders = new HashSet <string>(StringComparer.OrdinalIgnoreCase); HttpRequestHeaders.AddKnownHeaders(invalidHeaders); HttpResponseHeaders.AddKnownHeaders(invalidHeaders); HttpGeneralHeaders.AddKnownHeaders(invalidHeaders); return(invalidHeaders); }
static HttpContentHeaders() { parserStore = new Dictionary <string, HttpHeaderParser>(HeaderUtilities.CaseInsensitiveStringComparer); parserStore.Add(HttpKnownHeaderNames.Allow, GenericHeaderParser.TokenListParser); parserStore.Add(HttpKnownHeaderNames.ContentEncoding, GenericHeaderParser.TokenListParser); parserStore.Add(HttpKnownHeaderNames.ContentLanguage, GenericHeaderParser.TokenListParser); parserStore.Add(HttpKnownHeaderNames.ContentLength, Int64NumberHeaderParser.Parser); parserStore.Add(HttpKnownHeaderNames.ContentLocation, UriHeaderParser.RelativeOrAbsoluteUriParser); parserStore.Add(HttpKnownHeaderNames.ContentMD5, ByteArrayHeaderParser.Parser); parserStore.Add(HttpKnownHeaderNames.ContentRange, GenericHeaderParser.ContentRangeParser); parserStore.Add(HttpKnownHeaderNames.ContentType, MediaTypeHeaderParser.SingleValueParser); parserStore.Add(HttpKnownHeaderNames.Expires, DateHeaderParser.Parser); parserStore.Add(HttpKnownHeaderNames.LastModified, DateHeaderParser.Parser); invalidHeaders = new HashSet <string>(HeaderUtilities.CaseInsensitiveStringComparer); HttpRequestHeaders.AddKnownHeaders(invalidHeaders); HttpResponseHeaders.AddKnownHeaders(invalidHeaders); HttpGeneralHeaders.AddKnownHeaders(invalidHeaders); }