private bool IsNotSettableHeader(string headerName)
{
string[] names = new string[]
{
"Accept",
"Connection",
"Content-Length",
"Content-Type",
"Expect",
"Date",
"Host",
"If-Modified-Since",
"Range",
"Referer",
"Transfer-Encoding",
"User-Agent",
"Set-Cookie"
};
foreach(string name in names)
if(0 == string.Compare(name, headerName, true))
return true;
return false;
}