Search code examples
javascriptfirefoxiishttp-status-code-503

CORS headers not working only in Firefox


I'm having problems only on Mozilla Firefox, my requests are "Unavailable (503)" because of the missing header Access-Control-Allow-Origin.

However, the header is on the server side, inside my web.config:

<system.webServer>
<httpProtocol>
   <customHeaders>
    <add name="Access-Control-Allow-Origin" value="*" />
    <add name="Access-Control-Allow-Headers" value="Origin, X-Requested-With, Content-Type, Accept, Authorization" />
    <add name="Access-Control-Allow-Methods" value="GET, POST, PUT, DELETE, OPTIONS" />
  </customHeaders>

This is the error (translated from spanish):

Request from another blocked source: the same source policy: http: // XXXXX (reason: missing CORS 'Access-Control-Allow-Origin' header).

The problem does not happen on IE and Chrome. Any clues?

Thank you all!


Solution

  • Found the problem, maybe this could help someone:

    On the request uris I was using the server name instead of the IP. IE and Chrome were able to resolve this, Mozilla wasn't.

    I don't know how is this a problem for Mozilla anyway.

    Thank you all