From c1e0e01f8fb5553901234203d09e973f1ab2345e Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sat, 2 Jan 2021 13:47:43 +0200 Subject: [PATCH] vweb: simplify the `[post] pub fn` no routing fix check --- vlib/vweb/vweb.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vlib/vweb/vweb.v b/vlib/vweb/vweb.v index e8ce3c1457..3b2789a66c 100644 --- a/vlib/vweb/vweb.v +++ b/vlib/vweb/vweb.v @@ -419,7 +419,7 @@ fn handle_conn(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()`