4

I'm trying to make several CORS requests (PUT, GET, POST). The requests are working fine in Chrome and Safari. The options are rejected, but the other requests go through.

Below is my search function. Chrome and Safari invoke the callback with the returned data:

function Search (q, fn,){
console.log(q)
$.ajax({
    url: sumeURL+q,
    dataType: 'json',
    headers: headers
}).done(function(data){
    fn(data);
});
}

FireFox is logging the query string, so I know it is reading the AJAX call (I deleted my earlier question because I thought maybe FireFox was choking on something before it got to the AJAX - it did not).

I am using FireBug and the Net tab is not showing either the OPTIONS of GET requests from this Search function.

I've looked at this SO question, but I need to do this for production not development, so a Browser add on is not a good option.

What conditions would make FireFox refuse to send the request, but not matter to Chrome or Safari?

If you need me to post access control data from the server, LMK.

Community
  • 1
  • 1
Eric H.
  • 6,894
  • 8
  • 43
  • 62
  • Which version of Firefox are you using? Can you reproduce the error on http://test-cors.org – monsur Apr 15 '13 at 20:42
  • No I can't really set it up there because Access-Control-Allow-Origin is only allowed from certain domains (the domain I am making the request is included). I'm on FF 20.0 – Eric H. Apr 15 '13 at 21:43
  • From my experience, FF is logging the reason why it doesn't executed the request. So what does it log in your case? – oberlies Jul 09 '14 at 14:20

1 Answers1

2

Your answer could be in this response: Why does the preflight OPTIONS request of an authenticated CORS request work in Chrome but not Firefox?

It appears Firefox will stop sending requests if the pre-flight request response is a 401 whereas Webkit browsers will go ahead with the actual request (GET, POST, etc.)

EDIT: but then again, you are not even seeing the OPTIONS request being sent... still, the above mentioned post might be useful.

Community
  • 1
  • 1
woodedlawn
  • 126
  • 5
  • actually Chromium's behavior is logged as a bug: https://groups.google.com/a/chromium.org/forum/?fromgroups=#!topic/chromium-bugs/ihPAqQGNYnk this thread says it shouldn't be accepting the GET or POST after denying the OPTIONS – Eric H. Apr 15 '13 at 22:11