File tree 2 files changed +7
-8
lines changed
2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -155,7 +155,7 @@ pub(crate) struct Route {
155
155
/// this route. If 'allow' is used, all non-matching addresses are denied.
156
156
/// A 'deny' rule wins over an 'allow' one and the most specific subnet
157
157
/// takes precedence.
158
-
158
+ ///
159
159
/// Denied IP ranges. If a request matches, it'll be denied.
160
160
///
161
161
/// For how allowed ranges compare to denied ones, see `allowed_ranges`.
Original file line number Diff line number Diff line change @@ -18,13 +18,12 @@ pub(crate) fn is_http<R: Read>(rb: &ReaderBuf<R>) -> bool {
18
18
// fine.
19
19
let buf = rb. buf ( ) ;
20
20
if buf. len ( ) >= 5 {
21
- if let Ok ( method) = str:: from_utf8 ( & buf[ ..5 ] ) {
22
- match method {
23
- // From https://developer.mozilla.org/fr/docs/Web/HTTP/Methods
24
- "GET /" | "HEAD " | "POST " | "PUT /" | "DELET" | "CONNE" | "OPTIO" | "TRACE"
25
- | "PATCH" => return true ,
26
- _ => ( ) ,
27
- }
21
+ // From https://developer.mozilla.org/fr/docs/Web/HTTP/Methods
22
+ if let Ok (
23
+ "GET /" | "HEAD " | "POST " | "PUT /" | "DELET" | "CONNE" | "OPTIO" | "TRACE" | "PATCH" ,
24
+ ) = str:: from_utf8 ( & buf[ ..5 ] )
25
+ {
26
+ return true ;
28
27
}
29
28
}
30
29
false
You can’t perform that action at this time.
0 commit comments