HTTPClient::setAuthorization needs two allocations to support non-null terminated string views · Issue #8224 · esp8266/Arduino (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Description
Basic Infos
- This issue complies with the issue POLICY doc.
- I have read the documentation at readthedocs and the issue is not addressed there.
- I have tested that the issue is present in current master branch (aka latest git).
- I have searched the issue tracker for a similar issue.
- If there is a stack dump, I have decoded it.
- I have filled out all fields below.
Problem Description
We store our fixed size data in std::array<char, SIZE>. This brings a few problems when dealing with APIs that only receive a starting char pointer, but not the length. So we endup having to allocate a string just so we have a null-terminated string to pass to those APIs.
With HttpClient::setAuthorization this means we have to allocate twice. I'm here asking for support for non-null terminated views as first class. Be it by passing the size, or a String to be moved, so we control the string allocation.