Skip to content

Commit 76ae124

Browse files
committed
Return a json response when calling the timeout test
1 parent ab407d6 commit 76ae124

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/PHPCurlClass/server.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,11 @@
274274
$server->serve($unsafe_file_path);
275275
exit;
276276
} elseif ($test === 'timeout') {
277+
header('Content-Type: application/json');
277278
$unsafe_seconds = $_GET['seconds'];
278279
$start = time();
280+
echo '{' . "\n";
281+
echo ' "loading": "';
279282
while (true) {
280283
echo '.';
281284
ob_flush();
@@ -286,6 +289,9 @@
286289
break;
287290
}
288291
}
292+
echo '",' . "\n";
293+
echo ' "elapsed_seconds": "' . $elapsed . '"' . "\n";
294+
echo '}' . "\n";
289295
exit;
290296
} elseif ($test === 'error_message') {
291297
if (function_exists('http_response_code')) {

0 commit comments

Comments
 (0)