mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-01 01:14:34 -04:00
Add server timing for previews
This commit is contained in:
parent
3f610d68eb
commit
23a88f5a99
@ -177,6 +177,8 @@ class PreviewController extends BaseController
|
|||||||
return response()->json(['message' => 'This server cannot handle this request.'], 400);
|
return response()->json(['message' => 'This server cannot handle this request.'], 400);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$start = microtime(true);
|
||||||
|
|
||||||
/** @var \App\Models\User $user */
|
/** @var \App\Models\User $user */
|
||||||
$user = auth()->user();
|
$user = auth()->user();
|
||||||
|
|
||||||
@ -322,6 +324,8 @@ class PreviewController extends BaseController
|
|||||||
|
|
||||||
$response = Response::make($file_path, 200);
|
$response = Response::make($file_path, 200);
|
||||||
$response->header('Content-Type', 'application/pdf');
|
$response->header('Content-Type', 'application/pdf');
|
||||||
|
$response->header('Server-Timing', microtime(true)-$start);
|
||||||
|
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user