4 <script src=
"../../js-test-resources/js-test.js"></script>
7 <script type=
"text/javascript">
8 description("Allow lists starting with a comma should be parsed correctly.");
9 var xhr
= new XMLHttpRequest();
10 var url
= "http://localhost:8000/xmlhttprequest/resources/access-control-allow-lists.php?headers=,y-lol,x-print,%20,,,y-print&origin=http://127.0.0.1:8000";
11 xhr
.open("GET", url
, false);
12 xhr
.setRequestHeader('x-print', 'unicorn')
13 xhr
.setRequestHeader('y-print', 'narwhal')
14 debug("Sending GET request with custom headers.");
15 shouldBeUndefined("xhr.send(null)");
16 var response
= JSON
.parse(xhr
.response
)
17 shouldBeEqualToString("response['x-print']", "unicorn");
18 shouldBeEqualToString("response['y-print']", "narwhal");
20 url
= "http://localhost:8000/xmlhttprequest/resources/access-control-allow-lists.php?methods=,,PUT,GET&origin=http://127.0.0.1:8000";
21 xhr
.open("PUT", url
, false);
22 debug("Sending PUT request.");
23 shouldBeUndefined("xhr.send(null)");