proxy: de-duplicate method parsing in tap quickcheck (#472)

Signed-off-by: Sean McArthur <sean@seanmonstar.com>
This commit is contained in:
Sean McArthur 2018-02-28 14:12:36 -08:00 committed by GitHub
parent e57e74056e
commit 42ee56d1af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 9 deletions

View File

@ -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 {
err = Some(InvalidMatch::InvalidHttpMethod);
break;
}
if let Err(_) = ::http::Method::from_bytes(m.as_bytes()) {
err = Some(InvalidMatch::InvalidHttpMethod);
}
err
} else {