From 30acff0a67d3a8801980fb77dab828b5c806002c Mon Sep 17 00:00:00 2001 From: blek Date: Wed, 3 Jan 2024 13:46:24 +1000 Subject: [PATCH] replace "Content-Type header" with "MIME type" and add a section about the MIME type --- SPEC.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/SPEC.md b/SPEC.md index ed18b98..f162d09 100644 --- a/SPEC.md +++ b/SPEC.md @@ -25,9 +25,12 @@ Recommendations for implementations: # 1. File format The file is a serialized array of strings encoded with either JSON or CBOR. The filename MUST end with either `.json` or `.cbor` extension to clarify the encoding. -If there is no filename available in a specific context (like a multipart form), it MUST be indicated via something else, like HTTP's `Content-Type` header. +If there is no filename available in a specific context (like a multipart form), it MUST be indicated via something else, like a MIME type. See [3. Filename](#3-filename) for more details. +# 1.1 MIME type +One of two are allowed to be used as a MIME type: `application/x-blekaes-json` or `application/x-blekaes-cbor`. + # 2. Structure of the file The file MUST follow this schema: @@ -77,7 +80,7 @@ A file MUST be named according to this format: `(The file name).baes.(either jso If there is no filename available in a specific context (such as an HTTP multipart form), other indicators MAY be used to tell if the file is a blek!AES file: -1. Content-Type header must be either `application/x-blekaes-json` or `application/x-blekaes-cbor` +1. MIME type must be either `application/x-blekaes-json` or `application/x-blekaes-cbor` 2. The file is a JSON/CBOR encoded array of 7 elements, where the first element is always `0` (a JSON integer), and all other elements are strings, except for the last one which is an integer and can be one of the following values: 128, 192 or 256. # 4. Example of a file