X
Tap here to go to the mobile version of the site.
Your Firefox is out of date and may contain a security risk! Upgrade Firefox

Support Forum

Why am I getting "[Exception... "Access to restricted URI denied" code: "1012" nsresult: "0x805303f4 (NS_ERROR_DOM_BAD_URI)"? How do I solve the problem?

  • No replies
  • 6 have this problem
  • 27 views
Posted

I'm trying to implement CORS ajax request.

The server implements basic auth. The server responds with http 401 unathorized.

When I add the username and password to the request, I get this error message on the firebug console.

It doesn't appear the request was sent to the server, this message comes from the browser.

Additional System Details

This happened

Every time Firefox opened

This started when...

I added username and password to the xhr request

Application

  • User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4

More Information

jquery 172
Here is the ajax code:
$.ajax({
url: authenticate_url,
beforeSend: function (xhr) {
// xhr.setRequestHeader ('Authorization', 'Basic ' + btoa(form_map.username + ':' + form_map.password));
// xhr.setRequestHeader ('Authorization', 'Basic ' + btoa(form_map.username + ':' + form_map.password));
console.log('in beforesend xhr = %o', xhr);
},
success: function(data) {
console.log('in success data = %o', data);
$.cookie('username', form_map.username, { expires: form_map.days_session_expire, path: '/', domain : 'stevegoodwin.net', secure: true });
$.cookie('api_key', data.api_key, { expires: form_map.days_session_expire, path: '/', domain : 'stevegoodwin.net', secure: true });
$.cookie('user_language', form_map.user_language, { expires: form_map.days_session_expire, path: '/', domain : 'stevegoodwin.net', secure: true });
console.log('document.cookie = %o', document.cookie);
// window.location = redirect_url;
},
error: function(arguments) {
console.log('in error handler function arguments = %o', arguments)
},
username : 'xxxxxx',
password : 'xxxxxxxxx',
xhrFields: {
withCredentials: true,
username: 'xxxxxx',
password: 'xxxxxxxxx'
},
dataType: 'json'
});