mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
vweb: fix routing for 0 params (#5773)
This commit is contained in:
parent
c5dc1a33b6
commit
3792e17885
@ -364,7 +364,7 @@ fn handle_conn<T>(conn net.Socket, mut app T) {
|
|||||||
// since such methods have a priority.
|
// since such methods have a priority.
|
||||||
// For example URL `/register` matches route `/:user`, but `fn register()`
|
// For example URL `/register` matches route `/:user`, but `fn register()`
|
||||||
// should be called first.
|
// should be called first.
|
||||||
if (req.method == 'GET' && url_words[0] == method) || (req.method == 'POST' && url_words[0] + '_post' == method) {
|
if (req.method == 'GET' && url_words[0] == method && url_words.len == 1) || (req.method == 'POST' && url_words[0] + '_post' == method) {
|
||||||
println('easy match method=$method')
|
println('easy match method=$method')
|
||||||
app.$method(vars)
|
app.$method(vars)
|
||||||
conn.close() or {}
|
conn.close() or {}
|
||||||
|
Loading…
Reference in New Issue
Block a user