| <!DOCTYPE html> |
| <html> |
| <head> |
| <script src="/js-test-resources/js-test.js"></script> |
| <script> |
| description("Tests that a same-origin fetch load succeeds if the server blocks cross-origin loads with a 'From-Origin: same' response header."); |
| jsTestIsAsync = true; |
| |
| fetch("http://127.0.0.1:8000/from-origin/resources/fetch.php?fromOrigin=same").then(function(response) { |
| return response.json(); |
| }).then(function(data) { |
| const parsedData = JSON.parse(data); |
| if (parsedData.Fetch) |
| testPassed("Fetch succeeded."); |
| else |
| testFailed("Unknown fetch response."); |
| finishJSTest(); |
| }).catch(function(error) { |
| testFailed("Fetch blocked. " + error); |
| finishJSTest(); |
| }); |
| </script> |
| </head> |
| <body> |
| </body> |
| </html> |