Skip to content

HTTPClient::setAuthorization needs two allocations to support non-null terminated string views #8224

Closed
@paulocsanz

Description

@paulocsanz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions