So I'm doing a cross origin request (have tried via AngularJS, AJAX, and XMLHttpRequest) neither of them allow me to set the headers. I can send requests POST, GET... with and without data and it works fine, as soon as I add headers:
xhr.setRequestHeader("user","someUser");
or AJAX
headers: {"user":"someUser"}
I get the error:
405 (Method Not Allowed)
XMLHttpRequest cannot load http://testsite.com Invalid HTTP status code 405
From the backend side of things I am allowing all origins:
header("Access-Control-Allow-Origin: *");
Not sure what the problem can be anymore...