The emscripten_fetch_unpack_response_headers function in emscripten's fetch API will return header values with a single leading whitespace character ( ) and a trailing CRLF character (\r\n\).
This will apply all headers in the response.
Example: application/json\r\n will be returned when application/json is expected.
Code Example to reproduce:
char** response_headers =
emscripten_fetch_unpack_response_headers(some_buffer);
if (response_headers) {
for (int header_num = 0; response_headers[header_num];
header_num += 2) {
std::string key = response_headers[header_num];
std::string value = response_headers[header_num + 1];
cout << value << endl; // e.g. output " application/json\r\n"
}
emscripten_fetch_free_unpacked_response_headers(response_headers);
}
Version of emscripten/emsdk:
5.0.8-git
The
emscripten_fetch_unpack_response_headersfunction in emscripten's fetch API will return header values with a single leading whitespace character () and a trailing CRLF character (\r\n\).This will apply all headers in the response.
Example:
application/json\r\nwill be returned whenapplication/jsonis expected.Code Example to reproduce:
Version of emscripten/emsdk:
5.0.8-git