1
0
Fork 0
mirror of synced 2024-07-02 21:20:58 +12:00

PR review changes

This commit is contained in:
Matej Bačo 2024-01-24 12:40:56 +00:00
parent 5bd106afaf
commit f4a4cfa207
3 changed files with 6 additions and 6 deletions

View file

@ -305,7 +305,7 @@ App::patch('/v1/proxy/rules/:ruleId/verification')
$log->addExtra('dnsTiming', \strval(\microtime(true) - $validationStart));
$log->addTag('dnsDomain', $domain->get());
$error = $validator->getDnsResponse();
$error = $validator->getLogs();
$log->addExtra('dnsResponse', \is_array($error) ? \json_encode($error) : \strval($error));
throw new Exception(Exception::RULE_VERIFICATION_FAILED);

View file

@ -9,7 +9,7 @@ class CNAME extends Validator
/**
* @var mixed
*/
protected mixed $dnsResponse;
protected mixed $logs;
/**
* @var string
@ -35,9 +35,9 @@ class CNAME extends Validator
/**
* @return mixed
*/
public function getDnsResponse(): mixed
public function getLogs(): mixed
{
return $this->dnsResponse;
return $this->logs;
}
/**
@ -55,7 +55,7 @@ class CNAME extends Validator
try {
$records = \dns_get_record($domain, DNS_CNAME);
$this->dnsResponse = $records;
$this->logs = $records;
} catch (\Throwable $th) {
return false;
}

View file

@ -280,7 +280,7 @@ class Certificates extends Action
$log->addExtra('dnsTiming', \strval(\microtime(true) - $validationStart));
$log->addTag('dnsDomain', $domain->get());
$error = $validator->getDnsResponse();
$error = $validator->getLogs();
$log->addExtra('dnsResponse', \is_array($error) ? \json_encode($error) : \strval($error));
throw new Exception('Failed to verify domain DNS records.');