Rename endpoint network/whois to net/whois

master
Skylar Ittner 3 years ago
parent 0ed63d18bb
commit 4551d6a37b

@ -35,7 +35,7 @@ $APIS = [
"nocache (optional)" => "" "nocache (optional)" => ""
] ]
], ],
"network/whois" => [ "net/whois" => [
"load" => "network.whois.php", "load" => "network.whois.php",
"vars" => [ "vars" => [
"domain" => "/\b((?=[a-z0-9-]{1,63}\.)(xn--)?[a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,63}\b/", "domain" => "/\b((?=[a-z0-9-]{1,63}\.)(xn--)?[a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,63}\b/",

@ -16,7 +16,7 @@ use Iodev\Whois\Loaders\MemcachedLoader;
$json = []; $json = [];
$domain = $VARS["domain"]; $domain = $VARS["domain"];
if (empty($VARS["nocache"])) { if (empty($VARS["nocache"])) {
$cacheresp = $memcache->get("network.whois.$domain"); $cacheresp = $memcache->get("net.whois.$domain");
if ($cacheresp !== false) { if ($cacheresp !== false) {
exitWithJson(json_decode($cacheresp, true)); exitWithJson(json_decode($cacheresp, true));
} }
@ -49,7 +49,7 @@ try {
]; ];
} }
$json["status"] = "OK"; $json["status"] = "OK";
$memcache->set("network.whois.$domain", json_encode($json), 60 * 60 * 4); $memcache->set("net.whois.$domain", json_encode($json), 60 * 60 * 4);
exitWithJson($json); exitWithJson($json);
} catch (ConnectionException $e) { } catch (ConnectionException $e) {
sendJsonResp("Disconnect or connection timeout", "ERROR"); sendJsonResp("Disconnect or connection timeout", "ERROR");
Loading…
Cancel
Save