Uploaded image for project: 'MusicBrainz Server'
  1. MusicBrainz Server
  2. MBS-8882

CORS not supported for search API (both HTTP and HTTPS)

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Normal Normal
    • None
    • None
    • Web service
    • None

      From the tickets I've seen, CORS support seems to be a goal for the web service APIs. However, when I run the following in the Chrome console on my site (which is HTTPS) I get the following:

      $.getJSON("https://search.musicbrainz.org/ws/2/artist/?fmt=json&query=rolling+stones", function(data){ console.log("done") }).fail(function(){ console.log("failed")}); 
      Object {readyState: 1}
      XMLHttpRequest cannot load https://search.musicbrainz.org/ws/2/artist/?fmt=json&query=rolling+stones. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://mappable.com' is therefore not allowed access.
      

      After testing on an HTTP site (jquery.com) it looks like HTTP also doesn't have the CORS headers:

      $.getJSON("http://search.musicbrainz.org/ws/2/artist/?fmt=json&query=rolling+stones", function(data){ console.log("done") }).fail(function(){ console.log("failed")}); 
      Object {readyState: 1}
      (index):1 XMLHttpRequest cannot load http://search.musicbrainz.org/ws/2/artist/?fmt=json&query=rolling+stones. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://jquery.com' is therefore not allowed access.
      

      Is this a regression? Are you planning to keep it available? Much appreciated and thank you for an outstanding service.

          [MBS-8882] CORS not supported for search API (both HTTP and HTTPS)

          Michael Wiencek made changes -
          Resolution New: Invalid [ 6 ]
          Status Original: Open [ 1 ] New: Closed [ 6 ]

          search.musicbrainz.org isn't part of our public/documented API. I did find an incorrect mention of it on the wiki and fixed it at http://wiki.musicbrainz.org/index.php?title=Search_Server&diff=70402&oldid=68934

          Let us know if there's another place "search.musicbrainz.org" is mentioned.

          Michael Wiencek added a comment - search.musicbrainz.org isn't part of our public/documented API. I did find an incorrect mention of it on the wiki and fixed it at http://wiki.musicbrainz.org/index.php?title=Search_Server&diff=70402&oldid=68934 Let us know if there's another place "search.musicbrainz.org" is mentioned.

          And turns out that if I use https://musicbrainz.org or http://musicbrainz.org (instead of search.musicbrainz.org) things work. Still not sure if this is an issue or not.

          Orion Reblitz-Richardson added a comment - And turns out that if I use https://musicbrainz.org or http://musicbrainz.org (instead of search.musicbrainz.org ) things work. Still not sure if this is an issue or not.
          Orion Reblitz-Richardson made changes -
          Link New: This issue is related to MBS-2979 [ MBS-2979 ]

          Linking to general CORS support ticket, which has better details.

          Orion Reblitz-Richardson added a comment - Linking to general CORS support ticket, which has better details.
          Orion Reblitz-Richardson made changes -
          Link New: This issue is related to MBS-3072 [ MBS-3072 ]

          Linking to JSON support ticket.

          Orion Reblitz-Richardson added a comment - Linking to JSON support ticket.
          Orion Reblitz-Richardson created issue -

            Unassigned Unassigned
            orionr Orion Reblitz-Richardson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package