Update redbean GetResponseBody to take response compression into account (#561)

This commit is contained in:
Paul Kulchenko 2022-08-21 22:26:41 -07:00 committed by GitHub
parent e204fc0820
commit 04cd62c319
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 8 deletions

View file

@ -1067,9 +1067,13 @@ FUNCTIONS
IsPrivateIp or IsLoopbackIp return true. When multiple addresses
are present in the header, the last/right-most address is used.
GetResponseBody() → str
Returns the response message body if present or an empty string.
Also returns an empty string during streaming.
GetResponseBody()
├─→ body:str
└─→ nil, error:str
Returns the (uncompressed) response message body if present or an
empty string. May also return a partial or empty string during
streaming, as the full content may not be known at the call time.
Returns an error when decompression fails.
GetClientAddr() → ip:uint32,port:uint16
Returns client socket ip4 address and port, e.g. 0x01020304,31337