I'm trying to build an json/javascript interface to check emails on haveibeenpwned.
However, when trying to set the header, I get an error (in developer tools):
jquery-1.10.2.js:8699 Refused to set unsafe header "User-Agent"
This is my code:
$(document).ready(function() {
$.ajax({
url: 'https://haveibeenpwned.com/api/v2/breachedaccount/mark@fixitks.co.uk',
type: 'GET',
dataType: 'json',
success: function() { alert('hello!'); },
error: function() { alert('boo!'); }
,
headers: {
'User-Agent': 'uaheader'
}
});
});
I can run similar code from C# in the browser without any issues, but not in Javascript.
Is there anyway around this.
Thanks, Mark