Skip to content

Commit dc12519

Browse files
committed
Detect TLD metadata cache mode from API config host
1 parent 43d8916 commit dc12519

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

modules/registrars/openprovider/OpenProvider/API/ApiHelper.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,9 @@ public function getTldMeta(string $tld): array
702702
throw new \InvalidArgumentException('Missing TLD.');
703703
}
704704

705-
$mode = defined('MODE') ? MODE : 'live';
705+
$host = $this->apiClient->getConfiguration()->getHost();
706+
$mode = str_contains($host, 'sandbox') ? 'test' : 'live';
707+
706708
return DbCacheHelper::remember(
707709
'tld_meta_' . strtolower($tld),
708710
$mode,

0 commit comments

Comments
 (0)