[Webkit-unassigned] [Bug 136081] New: Safari fails on request to a non-authenticated API
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Aug 19 11:30:45 PDT 2014
https://bugs.webkit.org/show_bug.cgi?id=136081
Summary: Safari fails on request to a non-authenticated API
Product: WebKit
Version: 528+ (Nightly build)
Platform: Unspecified
URL: https://github.com/angular/angular.js/issues/8672
OS/Version: Unspecified
Status: NEW
Severity: Normal
Priority: P3
Component: New Bugs
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: Cory.Shaw.Dev at gmail.com
CC: caitpotter88 at gmail.com
When attempting to make a $http.get(AngularJS) request or any Ajax get request in Safari the following error log occurs. This same get request works in all other major browsers. Feel free to see the full code here: https://github.com/coryshaw1/ng-soundcloud-playlist
//SoudcloudService
vm.embed = function( trackUrl ) {
vm.trackUrl = trackUrl;
vm.url = 'http://api.soundcloud.com/oembed?format=json&url=' + vm.trackUrl + '&auto_play=true&maxheight=200';
return $http.get(vm.url); //Example url: http://api.soundcloud.com/oembed?format=json&url=http://soundcloud.com/flume/seekae-test-recognise-flume-re-work&auto_play=true&maxheight=200
};
...
//Calling in controller
SoundcloudService.embed( vm.list[index].permalink_url )
.success(function(data, status) {
vm.loading = false;
vm.embedHtml = $sce.trustAsHtml(data.html); //Is HTML5 iframe so handle javascript
}).error(function(data, status, headers, config) {
vm.loading = false;
var configText = function(){
var output = '';
for (var property in config) {
output += property + ': ' + config[property].toString()+'\n ';
}
return output;
}
var headersText = function(){
var output = '';
for (var property in headers) {
output += property + ': ' + headers[property].toString()+'\n ';
}
return output;
}
console.log('Status:', status,
'\nData:', data,
'\nHeaders:', headersText(),
'\nConfig:', configText());
});
//Console log
Failed to load resource: https://soundcloud.com/oembed?format=json&url=http://soundcloud.com/flume/seekae-test-recognise-flume-re-work&auto_play=true&maxheight=200 Cannot make any requests from null.
XMLHttpRequest cannot load https://soundcloud.com/oembed?format=json&url=http://soundcloud.com/flume/seekae-test-recognise-flume-re-work&auto_play=true&maxheight=200. Cannot make any requests from null.
Status: 0
Data:
Headers: Empty Object
Config:
method: GET
transformRequest: function (d) {
return isObject(d) && !isFile(d) && !isBlob(d) ? toJson(d) : d;
}
transformResponse: function (data) {
if (isString(data)) {
// strip json vulnerability protection prefix
data = data.replace(PROTECTION_PREFIX, '');
if (JSON_START.test(data) && JSON_END.test(data))
data = fromJson(data);
}
return data;
}
url: http://api.soundcloud.com/oembed?format=json&url=http://soundcloud.com/flume/seekae-test-recognise-flume-re-work&auto_play=true&maxheight=200
headers: Empty Object
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list