replace "Content-Type header" with "MIME type" and add a section about the MIME type

This commit is contained in:
blek 2024-01-03 13:46:24 +10:00
parent 753419b3a7
commit 30acff0a67
Signed by: blek
GPG Key ID: 14546221E3595D0C
1 changed files with 5 additions and 2 deletions

View File

@ -25,9 +25,12 @@ Recommendations for implementations:
# 1. File format # 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. 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. 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 # 2. Structure of the file
The file MUST follow this schema: 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: 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. 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 # 4. Example of a file