net: fix chunked check, remove length workaround (#10472)

pull/10474/head^2
JalonSolov 2021-06-15 12:28:54 -04:00 committed by GitHub
parent b0caadae31
commit aaa59ac770
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 8 deletions

View File

@ -68,9 +68,5 @@ pub fn decode(text string) string {
cscanner.skip_crlf()
}
cscanner.skip_crlf()
if sb.len > 0 {
return sb.str()
} else {
return text
}
}

View File

@ -66,9 +66,7 @@ pub fn parse_response(resp string) Response {
parts := cookie.split_nth('=', 2)
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)
}
return Response{