add allow header
This commit is contained in:
@@ -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())
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user