HTTPClient::setAuthorization needs two allocations to support non-null terminated string views · Issue #8224 · esp8266/Arduino (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

@paulocsanz

Description

@paulocsanz

Basic Infos

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.