| <title>XMLHttpRequest: setRequestHeader() - headers that are allowed</title> |
| <script src="/resources/testharness.js"></script> |
| <script src="/resources/testharnessreport.js"></script> |
| <link rel="help" href="https://xhr.spec.whatwg.org/#the-setrequestheader()-method" data-tested-assertations="/following::ol/li[6] /following::ol/li[7]" /> |
| function request(header) { |
| var client = new XMLHttpRequest() |
| client.open("POST", "resources/inspect-headers.py?filter_value=t1, t2", false) |
| client.setRequestHeader(header, "t1") |
| client.setRequestHeader(header, "t2") |
| assert_equals(client.responseText, header.toLowerCase() + ",") |
| }, document.title + " (" + header + ")") |
| request("Content-Transfer-Encoding") |
| request("X-Pink-Unicorn") |