private function validateRequest($serverKey) { // If the request comes from the local computer, then don't require authorization, // otherwise check the headers if (HttpUtils::isLocal()) { return true; } else { $providedServerkey = HttpUtils::getHeader(HEADER_SERVER_KEY); if (empty($serverKey)) { throw new MashapeException(EXCEPTION_EMPTY_SERVERKEY, EXCEPTION_XML_CODE); } if ($providedServerkey != null && md5($serverKey) == $providedServerkey) { return true; } return false; } }