I was trying to call an ajax request with Basic authentication, for that i added the following code,
url: appSettings.dataURL+'/app/signature',
type: 'GET',
crossDomain: true,
dataType: 'html',
context : this,
cache : true,
headers: {"Authorization": "Basic " + btoa('username' + ":" + 'password')}
This will make two requests, one with authentication and another without authentication when I inspect with network tab. Why?
See the screen shot,
Is it possible to avoid this?
Note: This happens only for cross domain requests.