1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

vweb: read the entire request body from buffered reader (#9644)

This commit is contained in:
Miccah
2021-04-09 02:53:33 -05:00
committed by GitHub
parent e93a52a267
commit 67ec33218e
2 changed files with 15 additions and 2 deletions

View File

@ -36,7 +36,10 @@ fn parse_request(mut reader io.BufferedReader) ?http.Request {
n := length.int()
if n > 0 {
body = []byte{len: n}
reader.read(mut body) or {}
mut count := 0
for count < body.len {
count += reader.read(mut body[count..]) or { break }
}
}
}
h.free()