From 07f00440bf0fbbc863c2e2c1a77d4c8568e03096 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Mon, 3 May 2021 16:55:13 +0300 Subject: [PATCH] picohttpparser: fix setting of req.body --- vlib/picohttpparser/request.v | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vlib/picohttpparser/request.v b/vlib/picohttpparser/request.v index a0039faabd..98667be09e 100644 --- a/vlib/picohttpparser/request.v +++ b/vlib/picohttpparser/request.v @@ -2,7 +2,7 @@ module picohttpparser pub struct Request { mut: - prev_len int + prev_len int pub mut: method string path string @@ -27,6 +27,7 @@ pub fn (mut r Request) parse_request(s string, max_headers int) int { } r.num_headers = u64(num_headers) } + r.body = unsafe { (&s.str[pret]).vstring_literal_with_len(s.len - pret) } r.prev_len = s.len return pret }