vweb: simplify the `[post] pub fn` no routing fix check

pull/7811/head
Delyan Angelov 2021-01-02 13:47:43 +02:00
parent d912ff165b
commit c1e0e01f8f
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 1 additions and 1 deletions

View File

@ -419,7 +419,7 @@ fn handle_conn<T>(mut conn net.TcpConn, mut app T) {
} else {
route_words_a = attrs.filter(it.to_lower() != 'get').map(it[1..].split('/'))
}
if attrs.len == 0 || (attrs.len == 1 && attrs[0][0] != `/`) {
if attrs.len == 0 || (attrs.len == 1 && route_words_a.len == 0 ) {
// No routing for this method. If it matches, call it and finish matching
// since such methods have a priority.
// For example URL `/register` matches route `/:user`, but `fn register()`