From 76ae1241cb20c230dc73d841897dca0dfe8029b8 Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Sat, 9 May 2020 23:04:58 -0700 Subject: [PATCH] Return a json response when calling the timeout test --- tests/PHPCurlClass/server.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/PHPCurlClass/server.php b/tests/PHPCurlClass/server.php index eecaf47..f3c9259 100644 --- a/tests/PHPCurlClass/server.php +++ b/tests/PHPCurlClass/server.php @@ -274,8 +274,11 @@ if ($test === 'http_basic_auth') { $server->serve($unsafe_file_path); exit; } elseif ($test === 'timeout') { + header('Content-Type: application/json'); $unsafe_seconds = $_GET['seconds']; $start = time(); + echo '{' . "\n"; + echo ' "loading": "'; while (true) { echo '.'; ob_flush(); @@ -286,6 +289,9 @@ if ($test === 'http_basic_auth') { break; } } + echo '",' . "\n"; + echo ' "elapsed_seconds": "' . $elapsed . '"' . "\n"; + echo '}' . "\n"; exit; } elseif ($test === 'error_message') { if (function_exists('http_response_code')) {