title: how to resolve Refused to set unsafe header "User-Agent" in Javascript
body: <p>I'm trying to build an json/javascript interface to check emails on haveibeenpwned.</p>
  
  <p>However, when trying to set the header, I get an error (in developer tools):</p>
  
  <blockquote>
    <p>jquery-1.10.2.js:8699 Refused to set unsafe header "User-Agent"</p>
  </blockquote>
  
  <p>This is my code:</p>
  
  <pre><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'
  }
      });
    });
  </code></pre>
  
  <p>I can run similar code from C# in the browser without any issues, but not in Javascript.</p>
  
  <p>Is there anyway around this.</p>
  
  <p>Thanks, Mark</p>