mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
vweb: split and parse Content-Type header correctly (#9756)
This commit is contained in:
@@ -85,6 +85,12 @@ pub fn (mut app App) json_echo() vweb.Result {
|
||||
return app.ok(app.req.data)
|
||||
}
|
||||
|
||||
['/form_echo'; post]
|
||||
pub fn (mut app App) form_echo() vweb.Result {
|
||||
app.set_content_type(app.req.header.get(.content_type) or { '' })
|
||||
return app.ok(app.form['foo'])
|
||||
}
|
||||
|
||||
// Make sure [post] works without the path
|
||||
[post]
|
||||
pub fn (mut app App) json() vweb.Result {
|
||||
|
||||
Reference in New Issue
Block a user