OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <head> |
| 3 <title>Upgrade Insecure Requests: Form Submission.</title> |
| 4 <script src="/resources/testharness.js"></script> |
| 5 <script src="/resources/testharnessreport.js"></script> |
| 6 </head> |
| 7 <body> |
| 8 <script> |
| 9 async_test(t => { |
| 10 var i = document.createElement('iframe'); |
| 11 i.srcdoc = "<meta http-equiv='Content-Security-Policy' content='upgrade-inse
cure-requests'>" + |
| 12 "<form action='http://127.0.0.1:8443/security/resources/post-orig
in-to-parent.html'></form>" + |
| 13 "<script>document.querySelector('form').submit()</scr" + "ipt>"; |
| 14 |
| 15 window.addEventListener('message', t.step_func(e => { |
| 16 if (e.source == i.contentWindow) { |
| 17 assert_equals("https://127.0.0.1:8443", e.data.origin); |
| 18 t.done(); |
| 19 } |
| 20 })); |
| 21 |
| 22 document.body.appendChild(i); |
| 23 }, "Same-host form submissions are upgraded."); |
| 24 |
| 25 async_test(t => { |
| 26 var i = document.createElement('iframe'); |
| 27 i.srcdoc = "<meta http-equiv='Content-Security-Policy' content='upgrade-inse
cure-requests'>" + |
| 28 "<form action='http://example.test:8443/security/resources/post-o
rigin-to-parent.html'></form>" + |
| 29 "<script>document.querySelector('form').submit()</scr" + "ipt>"; |
| 30 |
| 31 window.addEventListener('message', t.step_func(e => { |
| 32 if (e.source == i.contentWindow) { |
| 33 assert_equals("https://example.test:8443", e.data.origin); |
| 34 t.done(); |
| 35 } |
| 36 })); |
| 37 |
| 38 document.body.appendChild(i); |
| 39 }, "Cross-host form submissions are upgraded."); |
| 40 </script> |
| 41 </body> |
OLD | NEW |