This commit is contained in:
2021-09-16 14:19:05 +08:00
parent b94efaa63a
commit ad6aa3e7b5
3 changed files with 57 additions and 103 deletions
+2
View File
@@ -52,6 +52,8 @@ class Http extends \Server\Abstracts\Http implements OnClose, OnConnect
} catch (Error | \Throwable $exception) {
$psr7Response = $this->exceptionHandler->emit($exception, $this->response);
} finally {
$request_time_float = $request->server['request_time_float'] - $request->server['request_time'];
$psr7Response->withHeader('Run-Time', microtime(true) - $request_time_float);
$this->responseEmitter->sender($response, $psr7Response);
$this->eventDispatch->dispatch(new OnAfterRequest());
}