net: fix chunked check, remove length workaround (#10472)
parent
b0caadae31
commit
aaa59ac770
|
@ -68,9 +68,5 @@ pub fn decode(text string) string {
|
||||||
cscanner.skip_crlf()
|
cscanner.skip_crlf()
|
||||||
}
|
}
|
||||||
cscanner.skip_crlf()
|
cscanner.skip_crlf()
|
||||||
if sb.len > 0 {
|
|
||||||
return sb.str()
|
return sb.str()
|
||||||
} else {
|
|
||||||
return text
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,9 +66,7 @@ pub fn parse_response(resp string) Response {
|
||||||
parts := cookie.split_nth('=', 2)
|
parts := cookie.split_nth('=', 2)
|
||||||
cookies[parts[0]] = parts[1]
|
cookies[parts[0]] = parts[1]
|
||||||
}
|
}
|
||||||
if header.get(.transfer_encoding) or { '' } == 'chunked' || header.get(.content_length) or {
|
if header.get(.transfer_encoding) or { '' } == 'chunked' {
|
||||||
''
|
|
||||||
} == '' {
|
|
||||||
text = chunked.decode(text)
|
text = chunked.decode(text)
|
||||||
}
|
}
|
||||||
return Response{
|
return Response{
|
||||||
|
|
Loading…
Reference in New Issue