I wanted to lock down the Google Translation API use to my domain, but apparently there was no referrer set in the request.
To fix this I had to add the referrer to the $requestConfig array in GoogleCloudTranslationEngine.php, line 124, see PR.
$referer =
(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https://' : 'http://')
. $_SERVER['HTTP_HOST'];
$requestConfig = [
CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERAGENT => 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)',
CURLOPT_REFERER => $referer
];
With this change in place I can now add the domains I run the website on and set things up tighter.