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

http: chunked decoding support

This commit is contained in:
Delyan Angelov
2019-08-07 04:57:47 +03:00
committed by Alexander Medvednikov
parent 6bde860043
commit 7607b00952
3 changed files with 71 additions and 1 deletions

View File

@@ -5,6 +5,7 @@
module http
import net.urllib
import http.chunked
struct Request {
pub:
@@ -141,7 +142,10 @@ pub fn (req &Request) do() Response {
key := h.left(pos)
val := h.right(pos + 2)
headers[key] = val.trim_space()
}
}
if headers['Transfer-Encoding'] == 'chunked' {
text = chunked.decode( text )
}
return Response {
status_code: status_code
headers: headers