add allow header

This commit is contained in:
Rohan Prinja
2014-12-10 05:36:25 +05:30
parent e4bf1155de
commit 4bae6b7e0e
3 changed files with 68 additions and 12 deletions

View File

@@ -69,18 +69,22 @@ impl Method {
impl FromStr for Method {
fn from_str(s: &str) -> Option<Method> {
Some(match s {
"OPTIONS" => Options,
"GET" => Get,
"POST" => Post,
"PUT" => Put,
"DELETE" => Delete,
"HEAD" => Head,
"TRACE" => Trace,
"CONNECT" => Connect,
"PATCH" => Patch,
_ => Extension(s.to_string())
})
if s == "" {
None
} else {
Some(match s {
"OPTIONS" => Options,
"GET" => Get,
"POST" => Post,
"PUT" => Put,
"DELETE" => Delete,
"HEAD" => Head,
"TRACE" => Trace,
"CONNECT" => Connect,
"PATCH" => Patch,
_ => Extension(s.to_string())
})
}
}
}