Http.text and Http.header return copies - they handed back the handle's own buffer (and on macOS the response's string), which Http.free released: a text read before the free and used after it was garbage or empty (maroon-lake's maps.json was written with 0 bytes)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
aba5d9e679
commit
359de7bfe5
4 changed files with 19 additions and 4 deletions
|
|
@ -11,7 +11,7 @@ ns: Http
|
|||
member: header
|
||||
---
|
||||
|
||||
Returns a response header value by name (case-insensitive), or an empty result if absent.
|
||||
Returns a response header value by name (case-insensitive), or an empty result if absent. The value is a copy, yours to keep after <code>Http.free</code>.
|
||||
|
||||
```ludic
|
||||
program Demo {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ ns: Http
|
|||
member: text
|
||||
---
|
||||
|
||||
Returns the response body as a NUL-terminated string. Pair with <code>Json.parse</code> (#44) for JSON APIs.
|
||||
Returns the response body as a NUL-terminated string: a copy that stays yours after <code>Http.free</code> lets the handle go, so read it once and keep what you read. Pair with <code>Json.parse</code> (#44) for JSON APIs.
|
||||
|
||||
```ludic
|
||||
program Demo {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue