-
Bug
-
Resolution: Unresolved
-
Normal
-
None
-
None
Hello everyone,
I noticed a difference in Content-Type header depending whether a status code is 200 or 404. This makes it a bit hard to serialize/deserialize. Am I doing something wrong here? or is this maybe a bug?
I looked at the documentation here but I couldn't find anything related to accept headers:
However I found this in there:
> 406 if the server is unable to generate a response suitable to the Accept header
So that might indicate something, since I do not get a 406 when I request "Accept: application/json" in case it returns 404.
Example 404:
curl -i -L -H "Accept: application/json" -H "Content-Type: application/json" https://coverartarchive.org/release/9c0be6de-283e-4c94-9a83-4c46da772df0
Output:
HTTP/2 404 date: Thu, 11 Jun 2020 18:44:51 GMT content-type: text/html content-length: 179 access-control-allow-origin: * <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <title>404 Not Found</title> <h1>Not Found</h1> <p>No cover art found for release 9c0be6de-283e-4c94-9a83-4c46da772df0</p>
Example 200:
curl -i -L -H "Accept: application/json" -H "Content-Type: application/json" https://coverartarchive.org/release/77e201bf-635a-4c56-8e9e-794c6d093584
Output:
HTTP/2 307 date: Thu, 11 Jun 2020 18:46:40 GMT content-type: text/plain; charset=utf-8 content-length: 87 location: https://archive.org/download/mbid-77e201bf-635a-4c56-8e9e-794c6d093584/index.json access-control-allow-origin: * HTTP/1.1 302 Found Server: nginx/1.16.1 (Ubuntu) Date: Thu, 11 Jun 2020 18:46:41 GMT Content-Type: text/html; charset=UTF-8 Transfer-Encoding: chunked Connection: keep-alive Access-Control-Allow-Origin: * Accept-Ranges: bytes Location: https://ia803105.us.archive.org/0/items/mbid-77e201bf-635a-4c56-8e9e-794c6d093584/index.json Strict-Transport-Security: max-age=15724800 HTTP/1.1 200 OK Server: nginx/1.16.1 (Ubuntu) Date: Thu, 11 Jun 2020 18:46:42 GMT Content-Type: application/json Content-Length: 820 Last-Modified: Tue, 08 May 2018 00:00:40 GMT Connection: keep-alive ETag: "5af0e8a8-334" Strict-Transport-Security: max-age=15724800 Expires: Fri, 12 Jun 2020 00:46:42 GMT Cache-Control: max-age=21600 Access-Control-Allow-Origin: * Accept-Ranges: bytes {"images":[{"approved":true,"back":false,"comment":"","edit":52578305,"front":true,"id":19759325399,"image":"http://coverartarchive.org/release/77e201bf-635a-4c56-8e9e-794c6d093584/19759325399.png","thumbnails":{"1200":"http://coverartarchive.org/release/77e201bf-635a-4c56-8e9e-794c6d093584/19759325399-1200.jpg","250":"http://coverartarchive.org/release/77e201bf-635a-4c56-8e9e-794c6d093584/19759325399-250.jpg","500":"http://coverartarchive.org/release/77e201bf-635a-4c56-8e9e-794c6d093584/19759325399-500.jpg","large":"http://coverartarchive.org/release/77e201bf-635a-4c56-8e9e-794c6d093584/19759325399-500.jpg","small":"http://coverartarchive.org/release/77e201bf-635a-4c56-8e9e-794c6d093584/19759325399-250.jpg"},"types":["Front"]}],"release":"https://musicbrainz.org/release/77e201bf-635a-4c56-8e9e-794c6d093584"}