From 93920a4bb0d906038d4dc35c6defa9270ef67575 Mon Sep 17 00:00:00 2001 From: "Ian M. Jones" Date: Mon, 16 Mar 2020 13:30:55 +0000 Subject: [PATCH] vweb: set request data with body text to allow use in actions --- vlib/vweb/vweb.v | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vlib/vweb/vweb.v b/vlib/vweb/vweb.v index 4cea19aee7..228932f7d2 100644 --- a/vlib/vweb/vweb.v +++ b/vlib/vweb/vweb.v @@ -235,6 +235,7 @@ fn handle_conn(conn net.Socket, app mut T) { } req := http.Request{ headers: http.parse_headers(headers) //s.split_into_lines()) + data: strip(body) ws_func: 0 user_ptr: 0 method: vals[0] @@ -243,6 +244,7 @@ fn handle_conn(conn net.Socket, app mut T) { $if debug { println('req.headers = ') println(req.headers) + println('req.data="$req.data"' ) println('vweb action = "$action"') } //mut app := T{ @@ -255,9 +257,7 @@ fn handle_conn(conn net.Socket, app mut T) { } //} if req.method in methods_with_form { - body = strip(body) - println('body="$body"' ) - app.vweb.parse_form(body) + app.vweb.parse_form(req.data) } if vals.len < 2 { $if debug {