emscripten-core / emscripten-core/emscripten

[DOCU] Small description issue in fetch.h (requestHeaders)

Open
#13,001 1 comment 0 reactions 0 assignees View on GitHub
wontfix
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

emscripten V2.0.9 upstream

fetch.h (original)

```
// Points to an array of strings to pass custom headers to the request. This array takes the form
// {"key1", "value1", "key2", "value2", "key3", "value3", ..., 0 }; Note especially that the array
// needs to be terminated with a null pointer.
const char * const *requestHeaders;
```

Will the attribute `requestHeaders` set with this values `{"key", "value", 0}`, then I have an exception on xhr setReqeustHeader with "invalid utf 8 leading byte".

Made I the call with null-terminated strings `{"key\0", "value\0", 0}`, then will the request working.

**This is not an important task or feedback, more for information.**

_I use C++20_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.