| Behind The Math | c6247d2 | 2018-04-05 03:02:14 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <title>Test that sync requests (both OPTIONS preflight and regular) are sent with the User-Agent header</title> |
| 5 | <script src="/resources/testharness.js"></script> |
| 6 | <script src="/resources/testharnessreport.js"></script> |
| 7 | <script src="/common/get-host-info.sub.js"></script> |
| 8 | </head> |
| 9 | <body> |
| 10 | <script type="text/javascript"> |
| 11 | test(function() { |
| 12 | let xhr = new XMLHttpRequest; |
| 13 | xhr.open("post", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/header-user-agent.py", false); |
| 14 | xhr.setRequestHeader("x-test", "foobar"); |
| 15 | xhr.send(); |
| 16 | assert_equals(xhr.responseText, "PASS"); |
| 17 | }, "Sync request has User-Agent header"); |
| 18 | </script> |
| 19 | </body> |
| 20 | </html> |