registry: fix binary JSON content-type
This fixes registry endpoints to return the proper `application/json` content-type for JSON content, also updating spec examples for that. As per IETF specification and IANA registry [0], the `application/json` type is a binary media, so the content-type label does not need any text-charset selector. Additionally, the media type definition explicitly states that it has no required nor optional parameters, which makes the current registry headers non-compliant. [0]: https://www.iana.org/assignments/media-types/application/json Signed-off-by: Luca Bruno <lucab@debian.org>
This commit is contained in:
parent
91b0f0559e
commit
15b0204758
12 changed files with 135 additions and 135 deletions
|
@ -9,7 +9,7 @@ import (
|
|||
// and sets the content-type header to 'application/json'. It will handle
|
||||
// ErrorCoder and Errors, and if necessary will create an envelope.
|
||||
func ServeJSON(w http.ResponseWriter, err error) error {
|
||||
w.Header().Set("Content-Type", "application/json; charset=utf-8")
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
var sc int
|
||||
|
||||
switch errs := err.(type) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue