When sending request to google places photos api I am getting the following error in my firebase logs.
error: { Error: getaddrinfo ENOTFOUND lh4.googleusercontent.com lh4.googleusercontent.com:443
at errnoException (dns.js:28:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)
Which would seem it's related to a DNS lookup failure. Here is the code where I send the request. The url I submit is correct and valid, and I have checked this in the logs.
var getPhoto = function(request, response){
var req = require('request');
var url = "VALID_URL_HERE";
req(url, function(error, res, body){
response.send(body);
});
}
I have seen some similar answers saying you cannot make requests to external hosts. But I don't think this is my problem, as it is a google api service and I successfully call the google places api in another firebase function.
Any help is much appreciated.