Case of request headers depends on global state
Submitted by Ms2ger
Assigned to libsoup-maint@gnome.bugs
Link to original bug (#792176)
Description
Originally filed in https://bugs.webkit.org/show_bug.cgi?id=179475
http://w3c-test.org/fetch/api/basic/request-headers-case.any.html
soup_message_headers_append interns the header name case-insensitively, and always uses the casing it got in the first call. This means that
fetch("..", {headers: [["TEST", 1]] }) fetch("..", {headers: [["test", 1]] })
will the same header name twice. The name might be "TEST", or it might be any other casing which any other web page has used during the runtime of the browser.
This also provides a way of cross-origin communication: if a web page A uses a sufficiently unique header name in a particular casing, another web page B can check if page A was loaded before page B by checking what happens when using the header name in a different casing.