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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2016-01-11
    • Component/s: Embedded Metadata
    • Labels:
      None

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved:

                  Packages

                  Version Package
                  2016-01-11