Revision cd5bb894656e15405f1ab638cda9b24608e19f86 authored by Geoffrey Sneddon on 30 April 2018, 13:10:40 UTC, committed by Geoffrey Sneddon on 30 April 2018, 13:10:40 UTC
1 parent 2c46f38
Raw File
setrequestheader-allow-empty-value.htm
<!DOCTYPE html>
<html>
  <head>
    <title>XMLHttpRequest: setRequestHeader() - empty header</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">
  </head>
  <body>
    <div id="log"></div>
    <script>
      function request(value) {
        test(function() {
          var client = new XMLHttpRequest()
          client.open("POST", "resources/inspect-headers.py?filter_name=X-Empty", false)
          client.setRequestHeader('X-Empty', value)
          client.send(null)
          assert_equals(client.responseText, 'X-Empty: ' + value + '\n' )
        }, document.title + " (" + value + ")")
      }
      request("")
      request(null)
      request(undefined)
    </script>
  </body>
</html>
back to top