mirror of https://github.com/linkerd/linkerd2.git
proxy: de-duplicate method parsing in tap quickcheck (#472)
Signed-off-by: Sean McArthur <sean@seanmonstar.com>
This commit is contained in:
parent
e57e74056e
commit
42ee56d1af
|
@ -412,15 +412,8 @@ mod tests {
|
|||
None => Some(InvalidMatch::Empty),
|
||||
Some(&common::http_method::Type::Unregistered(ref m)) => if m.len() <= 15 {
|
||||
let mut err = None;
|
||||
for c in m.bytes() {
|
||||
let ok =
|
||||
b'A' <= c && c <= b'Z' ||
|
||||
b'a' <= c && c <= b'z' ||
|
||||
b'0' <= c && c <= b'9' ;
|
||||
if !ok {
|
||||
if let Err(_) = ::http::Method::from_bytes(m.as_bytes()) {
|
||||
err = Some(InvalidMatch::InvalidHttpMethod);
|
||||
break;
|
||||
}
|
||||
}
|
||||
err
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue