CORS headers not returned for rate limit responses

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Normal
    • Component/s: None
    • None

      As of right now, when I get rate-limited using the musicbrainz API, the error response doesn't include CORS headers:

       

      {"error": "Your requests are exceeding the allowable rate limit. Please see http://wiki.musicbrainz.org/XMLWebService for more information."} 

      I see this error in the browser network console:

      Response body is not available to scripts (Reason: CORS Missing Allow Origin) 

      This causes errors with the javascript I am trying to write:

      Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://musicbrainz.org/ws/2/release?collection=c3759587-4182-4a0d-83f9-37a884b75b41&inc=media%2Brelease-groups&offset=800&limit=100. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 503. 
      Uncaught (in promise) TypeError: NetworkError when attempting to fetch resource.  

      If the API error responses included CORS headers, then the library I am using can use those to rate limit, as I believe that's what it's using to restrict timing.

       

            Assignee:
            Michael Wiencek
            Reporter:
            aereaux
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package