OLD | NEW |
1 <?php | 1 <?php |
2 | 2 |
3 if ($_SERVER['REQUEST_METHOD'] == "OPTIONS") { | |
4 # No preflights should happen. | |
5 echo "FAIL"; | |
6 exit; | |
7 } | |
8 | |
9 if (isset($_GET['with_credentials'])) { | 3 if (isset($_GET['with_credentials'])) { |
10 header("Access-Control-Allow-Origin: http://127.0.0.1:8000"); | 4 header("Access-Control-Allow-Origin: http://127.0.0.1:8000"); |
11 header("Access-Control-Allow-Credentials: true"); | 5 header("Access-Control-Allow-Credentials: true"); |
12 } else { | 6 } else { |
13 header("Access-Control-Allow-Origin: *"); | 7 header("Access-Control-Allow-Origin: *"); |
14 } | 8 } |
15 @include("../../media/resources/serve-video.php"); | 9 |
| 10 $name = 'laughter.wav'; |
| 11 $fp = fopen($name, 'rb'); |
| 12 |
| 13 header("Content-Type: audio/x-wav"); |
| 14 header("Content-Length: " . filesize($name)); |
| 15 |
| 16 fpassthru($fp); |
| 17 exit; |
16 ?> | 18 ?> |
OLD | NEW |