vlang / gitly

Light and fast GitHub/GitLab alternative written in V
GNU General Public License v3.0
1.37k stars 72 forks source link

Fix /:user/:repo/move and /:user/:repo/settings routes #210

Closed SurmanPP closed 2 years ago

SurmanPP commented 2 years ago

Both routes did not work because the form data was not retrieved via app.form['data_name'] but via the functions args, which is not possible with vweb.

medvednikov commented 2 years ago

That's weird, function params should work in both GET and POST requests.

medvednikov commented 2 years ago

They do work in other places.

ghost commented 2 years ago

They do work in other places.

Yes, but only with static routes. Vweb ignores args passing if routes have dynamic params:

if !route.path.contains('/:') && url_words == route_words {

https://github.com/vlang/v/blob/f0871b87a4958253d09f48a6065e4dc3984573d9/vlib/vweb/vweb.v#L527

SurmanPP commented 2 years ago

That's weird, function params should work in both GET and POST requests.

What does this mean for this pull request and vweb? I'd rather remove this functionality in all places(in vweb), because I think it's more consisten without then with.

At least this behaviour should be documented. I can't find it anywhere.

medvednikov commented 2 years ago

@walkingdevel good find, needs to be fixed in vweb asap then.

SurmanPP commented 2 years ago

Beeing a bug in vweb makes this pr obsolete