public function endAuditRequest()
    {
        $auditRequest = $this->getAuditRequest();
        if (!in_array('response_headers', $this->auditRequestIgnoreFields) && function_exists('headers_list')) {
            $auditRequest->response_headers = headers_list();
        }
        if ($auditRequest->response_headers) {
            foreach ($auditRequest->response_headers as $header) {
                if (strpos(strtolower($header), 'location:') === 0) {
                    $auditRequest->redirect = trim(substr($header, 9));
                }
            }
            $auditRequest->response_headers = $this->removeValuesWithPasswordKeys($auditRequest->response_headers);
            $auditRequest->response_headers = AuditHelper::pack($auditRequest->response_headers);
        }

        $auditRequest->user_id = Yii::app()->user->id;
        $auditRequest->memory_usage = memory_get_usage();
        $auditRequest->memory_peak = memory_get_peak_usage();
        $auditRequest->audit_field_count = $auditRequest->auditFieldCount;
        $auditRequest->end_time = microtime(true);
        $auditRequest->total_time = $auditRequest->end_time - $auditRequest->start_time;
        $auditRequest->save(false);
    }