Note that the root cause here is the use of `toLower` on the header key. Since `toLower` will avoid allocating a new array if the input is already lower case, the slice of the original curl buffer is returned (if e.g. it's `content-type` instead of `Content-type`). This means you store a slice to a reusable buffer from curl as the string key.
For the reason why this is allowed, when `const(char)[]` does not convert to `string`, see issue 2954.
Comment #3 by dlang-bot — 2024-03-27T16:59:50Z
@MrcSnm updated dlang/phobos pull request #8961 "Fix Issue 24458 - Mac M3 associative array keys on std.net.curl gets overwritten" fixing this issue:
- Fix Bugzilla Issue 24458 - Mac M3 associative array keys on std.net.curl gets overwritten
https://github.com/dlang/phobos/pull/8961
Comment #4 by dlang-bot — 2024-03-31T19:39:41Z
dlang/phobos pull request #8961 "Fix Bugzilla Issue 24458 - Mac M3 associative array keys on std.net.curl gets overwritten" was merged into stable:
- afb0b3485b918e97caff0476f2e60e1d936aafeb by MrcSnm:
Fix Bugzilla Issue 24458 - Mac M3 associative array keys on std.net.curl gets overwritten
- 4d332baad1a053d8aa67ff3cff80f7787182cbe7 by MrcSnm:
Fix Bugzilla Issue 24458 - Mac M3 associative array keys on std.net.curl gets overwritten
https://github.com/dlang/phobos/pull/8961