net: fix 0 length file if Content-Header is missing or corrupt (#10464)

pull/10465/head
JalonSolov 2021-06-15 00:29:02 -04:00 committed by GitHub
parent 9bfec97a6d
commit 12bb0c236a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

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