OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../js-test-resources/js-test-pre.js"></script> | 4 <script src="../../js-test-resources/js-test-pre.js"></script> |
5 </head> | 5 </head> |
6 <body> | 6 <body> |
7 <script type="text/javascript"> | 7 <script type="text/javascript"> |
8 description("Allow lists starting with a comma should be parsed correctly."); | 8 description("Allow lists starting with a comma should be parsed correctly."); |
9 var xhr = new XMLHttpRequest(); | 9 var xhr = new XMLHttpRequest(); |
10 var url = "http://localhost:8000/xmlhttprequest/resources/access-control-allow-l
ists.php?headers=,y-lol,x-print,%20,,,y-print&origin=http://127.0.0.1:8000"; | 10 var url = "http://localhost:8000/xmlhttprequest/resources/access-control-allow-l
ists.php?headers=,y-lol,x-print,%20,,,y-print&origin=http://127.0.0.1:8000"; |
11 xhr.open("GET", url, false); | 11 xhr.open("GET", url, false); |
12 xhr.setRequestHeader('x-print', 'unicorn') | 12 xhr.setRequestHeader('x-print', 'unicorn') |
13 xhr.setRequestHeader('y-print', 'narwhal') | 13 xhr.setRequestHeader('y-print', 'narwhal') |
14 debug("Sending GET request with custom headers."); | 14 debug("Sending GET request with custom headers."); |
15 shouldBeUndefined("xhr.send(null)"); | 15 shouldBeUndefined("xhr.send(null)"); |
16 var response = JSON.parse(xhr.response) | 16 var response = JSON.parse(xhr.response) |
17 shouldBeEqualToString("response['x-print']", "unicorn"); | 17 shouldBeEqualToString("response['x-print']", "unicorn"); |
18 shouldBeEqualToString("response['y-print']", "narwhal"); | 18 shouldBeEqualToString("response['y-print']", "narwhal"); |
19 | 19 |
20 url = "http://localhost:8000/xmlhttprequest/resources/access-control-allow-lists
.php?methods=,,PUT,GET&origin=http://127.0.0.1:8000"; | 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); | 21 xhr.open("PUT", url, false); |
22 debug("Sending PUT request."); | 22 debug("Sending PUT request."); |
23 shouldBeUndefined("xhr.send(null)"); | 23 shouldBeUndefined("xhr.send(null)"); |
24 </script> | 24 </script> |
25 <script src="../../js-test-resources/js-test-post.js"></script> | |
26 </body> | 25 </body> |
27 </html> | 26 </html> |
OLD | NEW |