I am encountering an issue with my Angular JS code that reads a json file from Google Drive:
yummy.controller("slideCtrl", ['$scope', function($scope) {
}]).directive('slideElement', ['$interval', '$http',($interval, $http) {
return {
restrict: 'E',
link: function(scope, element, attrs) {
var path = 'https://googledrive.com/host/0B-74lO-UfPKoaDRySEsyQkZwNjQ/';
element.html('<div class="loading"><img src="img/loading.gif"></div>');
$http({
method: 'GET',
url: path + 'reduced.json'
}).then(function(response) {
console.log(response.data);
});
}]);
While this code works fine in Chrome, Firefox, and IE, I am facing an error in Safari:
Failed to load resource: Request header field Accept-Encoding is not allowed by Access-Control-Allow-Headers.
I have attempted to resolve this issue by adding the following code:
{ headers: { 'Accept-Encoding': undefined }}
Unfortunately, this solution did not fix the problem. Can anyone provide guidance on how to make my code compatible with Safari? Thank you.