Main resource requests need cachePartition
[WebKit-https.git] / LayoutTests / http / tests / security / resources / credentials-main-resource.php
1 <?php 
2     if (!isset($_SERVER['PHP_AUTH_USER'])) {
3         header('WWW-Authenticate: Basic realm="WebKit test - credentials-in-main-resource"');
4         header('HTTP/1.0 401 Unauthorized');
5         exit;
6     }
7     echo "Main Resource Credentials: " . $_SERVER['PHP_AUTH_USER'] . ", " . $_SERVER['PHP_AUTH_PW'] . "<br/>";
8 ?>
9 <script>
10
11 if (window.internals)
12     internals.settings.setStorageBlockingPolicy('BlockThirdParty');
13
14 var request = new XMLHttpRequest();
15 request.onreadystatechange = function () {
16     if (this.readyState == 4) {
17         alert(this.responseText);
18                 if (window.testRunner)
19                         testRunner.notifyDone();
20         }
21 };
22 request.open('GET', 'http://127.0.0.1:8000/security/resources/basic-auth.php?username=testuser&password=testpass', true);
23 request.send(null);
24 </script>