When using a custom header (If-Modified-Since
) in the code below, it causes ajax to fail with a status of HTTP/1.1 405 Not Allowed
for the OPTIONS
preflight request. However, if the header is removed, the request works as expected (I am unsure if OPTIONS
is not sent at all or if developer consoles just do not display it). Why does this happen? (Similar situation occurs with jquery hosted on googleapis).
http = new XMLHttpRequest();
http.open('GET', 'http://code.jquery.com/jquery-2.1.4.min.js');
http.setRequestHeader('If-Modified-Since', 'Sat, 29 Oct 1994 19:43:31 GMT')
http.send();
Furthermore, is there a method to include this header in the xhr request to the jquery cdn in order to receive a 304
response status?