Refactored WebHeaderCollection.cs

This commit is contained in:
sta 2014-12-04 15:51:22 +09:00
parent dbe97b4d00
commit 3b297e3d7d

View File

@ -75,439 +75,375 @@ namespace WebSocketSharp.Net
new Dictionary<string, HttpHeaderInfo> (StringComparer.InvariantCultureIgnoreCase) { new Dictionary<string, HttpHeaderInfo> (StringComparer.InvariantCultureIgnoreCase) {
{ {
"Accept", "Accept",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Accept", "Accept",
Type = HttpHeaderType.Request | HttpHeaderType.Restricted | HttpHeaderType.MultiValue HttpHeaderType.Request | HttpHeaderType.Restricted | HttpHeaderType.MultiValue)
}
}, },
{ {
"AcceptCharset", "AcceptCharset",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Accept-Charset", "Accept-Charset",
Type = HttpHeaderType.Request | HttpHeaderType.MultiValue HttpHeaderType.Request | HttpHeaderType.MultiValue)
}
}, },
{ {
"AcceptEncoding", "AcceptEncoding",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Accept-Encoding", "Accept-Encoding",
Type = HttpHeaderType.Request | HttpHeaderType.MultiValue HttpHeaderType.Request | HttpHeaderType.MultiValue)
}
}, },
{ {
"AcceptLanguage", "AcceptLanguage",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Accept-language", "Accept-language",
Type = HttpHeaderType.Request | HttpHeaderType.MultiValue HttpHeaderType.Request | HttpHeaderType.MultiValue)
}
}, },
{ {
"AcceptRanges", "AcceptRanges",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Accept-Ranges", "Accept-Ranges",
Type = HttpHeaderType.Response | HttpHeaderType.MultiValue HttpHeaderType.Response | HttpHeaderType.MultiValue)
}
}, },
{ {
"Age", "Age",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Age", "Age",
Type = HttpHeaderType.Response HttpHeaderType.Response)
}
}, },
{ {
"Allow", "Allow",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Allow", "Allow",
Type = HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.MultiValue HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.MultiValue)
}
}, },
{ {
"Authorization", "Authorization",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Authorization", "Authorization",
Type = HttpHeaderType.Request | HttpHeaderType.MultiValue HttpHeaderType.Request | HttpHeaderType.MultiValue)
}
}, },
{ {
"CacheControl", "CacheControl",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Cache-Control", "Cache-Control",
Type = HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.MultiValue HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.MultiValue)
}
}, },
{ {
"Connection", "Connection",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Connection", "Connection",
Type = HttpHeaderType.Request | HttpHeaderType.Request |
HttpHeaderType.Response | HttpHeaderType.Response |
HttpHeaderType.Restricted | HttpHeaderType.Restricted |
HttpHeaderType.MultiValue HttpHeaderType.MultiValue)
}
}, },
{ {
"ContentEncoding", "ContentEncoding",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Content-Encoding", "Content-Encoding",
Type = HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.MultiValue HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.MultiValue)
}
}, },
{ {
"ContentLanguage", "ContentLanguage",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Content-Language", "Content-Language",
Type = HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.MultiValue HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.MultiValue)
}
}, },
{ {
"ContentLength", "ContentLength",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Content-Length", "Content-Length",
Type = HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.Restricted HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.Restricted)
}
}, },
{ {
"ContentLocation", "ContentLocation",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Content-Location", "Content-Location",
Type = HttpHeaderType.Request | HttpHeaderType.Response HttpHeaderType.Request | HttpHeaderType.Response)
}
}, },
{ {
"ContentMd5", "ContentMd5",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Content-MD5", "Content-MD5",
Type = HttpHeaderType.Request | HttpHeaderType.Response HttpHeaderType.Request | HttpHeaderType.Response)
}
}, },
{ {
"ContentRange", "ContentRange",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Content-Range", "Content-Range",
Type = HttpHeaderType.Request | HttpHeaderType.Response HttpHeaderType.Request | HttpHeaderType.Response)
}
}, },
{ {
"ContentType", "ContentType",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Content-Type", "Content-Type",
Type = HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.Restricted HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.Restricted)
}
}, },
{ {
"Cookie", "Cookie",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Cookie", "Cookie",
Type = HttpHeaderType.Request HttpHeaderType.Request)
}
}, },
{ {
"Cookie2", "Cookie2",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Cookie2", "Cookie2",
Type = HttpHeaderType.Request HttpHeaderType.Request)
}
}, },
{ {
"Date", "Date",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Date", "Date",
Type = HttpHeaderType.Request | HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.Restricted)
HttpHeaderType.Response |
HttpHeaderType.Restricted
}
}, },
{ {
"Expect", "Expect",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Expect", "Expect",
Type = HttpHeaderType.Request | HttpHeaderType.Restricted | HttpHeaderType.MultiValue HttpHeaderType.Request | HttpHeaderType.Restricted | HttpHeaderType.MultiValue)
}
}, },
{ {
"Expires", "Expires",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Expires", "Expires",
Type = HttpHeaderType.Request | HttpHeaderType.Response HttpHeaderType.Request | HttpHeaderType.Response)
}
}, },
{ {
"ETag", "ETag",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "ETag", "ETag",
Type = HttpHeaderType.Response HttpHeaderType.Response)
}
}, },
{ {
"From", "From",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "From", "From",
Type = HttpHeaderType.Request HttpHeaderType.Request)
}
}, },
{ {
"Host", "Host",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Host", "Host",
Type = HttpHeaderType.Request | HttpHeaderType.Restricted HttpHeaderType.Request | HttpHeaderType.Restricted)
}
}, },
{ {
"IfMatch", "IfMatch",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "If-Match", "If-Match",
Type = HttpHeaderType.Request | HttpHeaderType.MultiValue HttpHeaderType.Request | HttpHeaderType.MultiValue)
}
}, },
{ {
"IfModifiedSince", "IfModifiedSince",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "If-Modified-Since", "If-Modified-Since",
Type = HttpHeaderType.Request | HttpHeaderType.Restricted HttpHeaderType.Request | HttpHeaderType.Restricted)
}
}, },
{ {
"IfNoneMatch", "IfNoneMatch",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "If-None-Match", "If-None-Match",
Type = HttpHeaderType.Request | HttpHeaderType.MultiValue HttpHeaderType.Request | HttpHeaderType.MultiValue)
}
}, },
{ {
"IfRange", "IfRange",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "If-Range", "If-Range",
Type = HttpHeaderType.Request HttpHeaderType.Request)
}
}, },
{ {
"IfUnmodifiedSince", "IfUnmodifiedSince",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "If-Unmodified-Since", "If-Unmodified-Since",
Type = HttpHeaderType.Request HttpHeaderType.Request)
}
}, },
{ {
"KeepAlive", "KeepAlive",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Keep-Alive", "Keep-Alive",
Type = HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.MultiValue HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.MultiValue)
}
}, },
{ {
"LastModified", "LastModified",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Last-Modified", "Last-Modified",
Type = HttpHeaderType.Request | HttpHeaderType.Response HttpHeaderType.Request | HttpHeaderType.Response)
}
}, },
{ {
"Location", "Location",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Location", "Location",
Type = HttpHeaderType.Response HttpHeaderType.Response)
}
}, },
{ {
"MaxForwards", "MaxForwards",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Max-Forwards", "Max-Forwards",
Type = HttpHeaderType.Request HttpHeaderType.Request)
}
}, },
{ {
"Pragma", "Pragma",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Pragma", "Pragma",
Type = HttpHeaderType.Request | HttpHeaderType.Response HttpHeaderType.Request | HttpHeaderType.Response)
}
}, },
{ {
"ProxyConnection", "ProxyConnection",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Proxy-Connection", "Proxy-Connection",
Type = HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.Restricted HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.Restricted)
}
}, },
{ {
"ProxyAuthenticate", "ProxyAuthenticate",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Proxy-Authenticate", "Proxy-Authenticate",
Type = HttpHeaderType.Response | HttpHeaderType.MultiValue HttpHeaderType.Response | HttpHeaderType.MultiValue)
}
}, },
{ {
"ProxyAuthorization", "ProxyAuthorization",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Proxy-Authorization", "Proxy-Authorization",
Type = HttpHeaderType.Request HttpHeaderType.Request)
}
}, },
{ {
"Public", "Public",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Public", "Public",
Type = HttpHeaderType.Response | HttpHeaderType.MultiValue HttpHeaderType.Response | HttpHeaderType.MultiValue)
}
}, },
{ {
"Range", "Range",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Range", "Range",
Type = HttpHeaderType.Request | HttpHeaderType.Restricted | HttpHeaderType.MultiValue HttpHeaderType.Request | HttpHeaderType.Restricted | HttpHeaderType.MultiValue)
}
}, },
{ {
"Referer", "Referer",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Referer", "Referer",
Type = HttpHeaderType.Request | HttpHeaderType.Restricted HttpHeaderType.Request | HttpHeaderType.Restricted)
}
}, },
{ {
"RetryAfter", "RetryAfter",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Retry-After", "Retry-After",
Type = HttpHeaderType.Response HttpHeaderType.Response)
}
}, },
{ {
"SecWebSocketAccept", "SecWebSocketAccept",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Sec-WebSocket-Accept", "Sec-WebSocket-Accept",
Type = HttpHeaderType.Response | HttpHeaderType.Restricted HttpHeaderType.Response | HttpHeaderType.Restricted)
}
}, },
{ {
"SecWebSocketExtensions", "SecWebSocketExtensions",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Sec-WebSocket-Extensions", "Sec-WebSocket-Extensions",
Type = HttpHeaderType.Request | HttpHeaderType.Request |
HttpHeaderType.Response | HttpHeaderType.Response |
HttpHeaderType.Restricted | HttpHeaderType.Restricted |
HttpHeaderType.MultiValueInRequest HttpHeaderType.MultiValueInRequest)
}
}, },
{ {
"SecWebSocketKey", "SecWebSocketKey",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Sec-WebSocket-Key", "Sec-WebSocket-Key",
Type = HttpHeaderType.Request | HttpHeaderType.Restricted HttpHeaderType.Request | HttpHeaderType.Restricted)
}
}, },
{ {
"SecWebSocketProtocol", "SecWebSocketProtocol",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Sec-WebSocket-Protocol", "Sec-WebSocket-Protocol",
Type = HttpHeaderType.Request | HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.MultiValueInRequest)
HttpHeaderType.Response |
HttpHeaderType.MultiValueInRequest
}
}, },
{ {
"SecWebSocketVersion", "SecWebSocketVersion",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Sec-WebSocket-Version", "Sec-WebSocket-Version",
Type = HttpHeaderType.Request | HttpHeaderType.Request |
HttpHeaderType.Response | HttpHeaderType.Response |
HttpHeaderType.Restricted | HttpHeaderType.Restricted |
HttpHeaderType.MultiValueInResponse HttpHeaderType.MultiValueInResponse)
}
}, },
{ {
"Server", "Server",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Server", "Server",
Type = HttpHeaderType.Response HttpHeaderType.Response)
}
}, },
{ {
"SetCookie", "SetCookie",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Set-Cookie", "Set-Cookie",
Type = HttpHeaderType.Response | HttpHeaderType.MultiValue HttpHeaderType.Response | HttpHeaderType.MultiValue)
}
}, },
{ {
"SetCookie2", "SetCookie2",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Set-Cookie2", "Set-Cookie2",
Type = HttpHeaderType.Response | HttpHeaderType.MultiValue HttpHeaderType.Response | HttpHeaderType.MultiValue)
}
}, },
{ {
"Te", "Te",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "TE", "TE",
Type = HttpHeaderType.Request HttpHeaderType.Request)
}
}, },
{ {
"Trailer", "Trailer",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Trailer", "Trailer",
Type = HttpHeaderType.Request | HttpHeaderType.Response HttpHeaderType.Request | HttpHeaderType.Response)
}
}, },
{ {
"TransferEncoding", "TransferEncoding",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Transfer-Encoding", "Transfer-Encoding",
Type = HttpHeaderType.Request | HttpHeaderType.Request |
HttpHeaderType.Response | HttpHeaderType.Response |
HttpHeaderType.Restricted | HttpHeaderType.Restricted |
HttpHeaderType.MultiValue HttpHeaderType.MultiValue)
}
}, },
{ {
"Translate", "Translate",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Translate", "Translate",
Type = HttpHeaderType.Request HttpHeaderType.Request)
}
}, },
{ {
"Upgrade", "Upgrade",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Upgrade", "Upgrade",
Type = HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.MultiValue HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.MultiValue)
}
}, },
{ {
"UserAgent", "UserAgent",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "User-Agent", "User-Agent",
Type = HttpHeaderType.Request | HttpHeaderType.Restricted HttpHeaderType.Request | HttpHeaderType.Restricted)
}
}, },
{ {
"Vary", "Vary",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Vary", "Vary",
Type = HttpHeaderType.Response | HttpHeaderType.MultiValue HttpHeaderType.Response | HttpHeaderType.MultiValue)
}
}, },
{ {
"Via", "Via",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Via", "Via",
Type = HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.MultiValue HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.MultiValue)
}
}, },
{ {
"Warning", "Warning",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "Warning", "Warning",
Type = HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.MultiValue HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.MultiValue)
}
}, },
{ {
"WwwAuthenticate", "WwwAuthenticate",
new HttpHeaderInfo () { new HttpHeaderInfo (
Name = "WWW-Authenticate", "WWW-Authenticate",
Type = HttpHeaderType.Response | HttpHeaderType.Restricted | HttpHeaderType.MultiValue HttpHeaderType.Response | HttpHeaderType.Restricted | HttpHeaderType.MultiValue)
}
} }
}; };
} }