There is a JavaScript snippet that does
$.getJSON(....)
Depending how the page loads it sometimes puts "Authentication" header to the request which comes from some other JavaScript code that is not related.
It seems $.getJSON(...) adds it automatically there if its present. I guess it's not possible to remove it with getJSON?
Is it possible to do with .ajax(...) so that I don't sent it?
I tried using .ajax with "beforeSend" by setting it to null and undefined but it will still send the header then, just with empty value.
$.ajax({
url: 'service.svc/Request',
type: 'GET',
dataType: 'json',
success: function() { alert('hello!'); },
error: function() { alert('boo!'); },
beforeSend: setHeader
});
});
function setHeader(xhr) {
xhr.setRequestHeader('Authorization', 'undefined');
}