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

Content negotiation for JSON-LD representation does not work with multiple MIME types in Accept header

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 2016-01-11
    • None
    • Embedded Metadata
    • None

      For instance when using curl to make a request and setting Accept header to accept JSON-LD (application/ld+json) works fine:

      C:\>curl https://musicbrainz.org/artist/22a1f4d7-81ff-4216-ac06-3387da6bc118 -H "Accept: application/ld+json" -k -I
      HTTP/1.1 200 OK
      Date: Mon, 21 Dec 2015 17:02:57 GMT
      Content-Type: application/ld+json; charset=utf-8
      Content-Length: 11744
      Connection: keep-alive
      Keep-Alive: timeout=20
      Server: nginx/1.4.6 (Ubuntu)

      But many Linked Data applications specify multiple MIME types in the request header for example JSON-LD and Turtle, in which case MusicBrainz returns the text/html representation:

      C:\>curl https://musicbrainz.org/artist/22a1f4d7-81ff-4216-ac06-3387da6bc118 -H "Accept: application/ld+json, text/turtle" -k -I
      HTTP/1.1 200 OK
      Date: Mon, 21 Dec 2015 17:04:41 GMT
      Content-Type: text/html; charset=utf-8
      Content-Length: 0
      Connection: keep-alive
      Keep-Alive: timeout=20
      Server: nginx/1.4.6 (Ubuntu)

      In such cases it would be preferable to return the JSON-LD representation.

            chirlu Ulrich Klauer
            jaw111 John Walker
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package
                2016-01-11