private static CorsHttpMethods GetCorsMethods(string verbString)
{
Dictionary<string, CorsHttpMethods> lookup = new Dictionary<string, CorsHttpMethods>
{
{"PUT", CorsHttpMethods.Put},
{"POST", CorsHttpMethods.Post},
{"GET", CorsHttpMethods.Get},
{"DELETE", CorsHttpMethods.Delete},
{"HEAD", CorsHttpMethods.Head},
{"OPTIONS", CorsHttpMethods.Options},
{"TRACE", CorsHttpMethods.Trace},
{"MERGE", CorsHttpMethods.Merge},
{"CONNECT", CorsHttpMethods.Connect}
};
CorsHttpMethods result = CorsHttpMethods.None;
string[] verbs = verbString.Split(',');
foreach (string verb in verbs)
{
result |= lookup[verb];
}
return result;
}