chromium/third_party/blink/web_tests/http/tests/xmlhttprequest/xmlhttprequest-setrequestheader-no-value.html

<html>
<body>
<p>Test that setRequestHeader can be used to set headers that have a name, but no value.</p>
<pre id=result>FAIL: script didn't run or raised an unexpected exception.</pre>
<script>
    if (window.testRunner)
        testRunner.dumpAsText();
    
    req = new XMLHttpRequest;
    req.open("GET", "resources/print-headers.cgi", false);

    req.setRequestHeader("CUSTOM-HEADER", "");
    try {
        req.send("");
        if (req.responseText.indexOf("HTTP_CUSTOM_HEADER") >= 0)
            document.getElementById("result").textContent = "SUCCESS";
        else
            document.getElementById("result").textContent = req.responseText;
    } catch (ex) {
        document.getElementById("result").textContent = ex;
    }
</script>
</body>
</html>