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

http: avoid costly string interpolation of resp.body (#15376)

This commit is contained in:
jrfondren 2022-08-07 20:36:45 -05:00 committed by GitHub
parent d74cf084fb
commit 0b1486f014
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,7 +31,7 @@ pub fn (resp Response) bytes() []u8 {
pub fn (resp Response) bytestr() string {
return 'HTTP/$resp.http_version $resp.status_code $resp.status_msg\r\n' + '${resp.header.render(
version: resp.version()
)}\r\n' + '$resp.body'
)}\r\n' + resp.body
}
// Parse a raw HTTP response into a Response object