vweb: fix array.last usage (#7905)

pull/7912/head
Daniel Däschle 2021-01-06 01:24:36 +01:00 committed by GitHub
parent e219f954d8
commit 42e60b8e27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -447,7 +447,7 @@ fn handle_conn<T>(mut conn net.TcpConn, mut app T) {
req_method << route_words[0]
}
if url_words.len == route_words.len ||
(url_words.len >= route_words.len - 1 && route_words.last().ends_with('...')) {
(url_words.len >= route_words.len - 1 && route_words.len > 0 && route_words.last().ends_with('...')) {
if req_method.len > 0 {
if req_method_str.to_lower()[1..] !in req_method {
continue