I'm trying to download a facebook profile photo using Parse Cloud Code and save it, however, it seems the redirect is not working properly - can someone give me some guidance? Thanks!
Parse.Cloud.httpRequest({
url: pictureURL,
followRedirects: true
}).then(function(httpResponse){
var imgFile = new Parse.File(request.user.id+".jpg" , httpResponse.buffer);
//the httpResponse does not resolve correctly
return imgFile.save();
}).then(function(){
request.user.set(constants.kBPUserProfileImageKey, image);
request.user.save();
response.success("updated image");
},function(error) {
response.error("failed to save object");
});