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:
committed by
Alexander Medvednikov
parent
6bde860043
commit
7607b00952
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user