diff --git a/README.md b/README.md index af5cb74..d53c6d3 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# 🌸 Blossom - Blobs stored simply on mediaservers +# 🌸 Blossom - Blobs stored simply on mediaservers ## What is it? diff --git a/buds/bud-01.md b/buds/bud-01.md index 37b18fc..eca0940 100644 --- a/buds/bud-01.md +++ b/buds/bud-01.md @@ -133,9 +133,11 @@ The endpoint MUST accept an optional file extension in the URL similar to the `G ### PUT /upload - Upload Blob -The `PUT /upload` endpoint should expect the `Content-Type` header of the request to be set to the MIME type of the blob and the body of the request to the raw data of the blob. +The `PUT /upload` endpoint MUST accept binary data in the body of the request and MAY use the `Content-Type` header to get the MIME type of the data -The endpoint MUST return a [Blob Descriptor](./README.md#blob-descriptor) if the upload was successful or an error object if not. +The endpoint MUST NOT modify the blob in any way and should return the exact same sha256 that was uploaded. This is critical to allow users to re-upload their blobs to new servers + +The endpoint MUST return a [Blob Descriptor](./README.md#blob-descriptor) if the upload was successful or an error object if not Servers MAY reject an upload for any reason and should respond with the appropriate HTTP `4xx` status code and an error message explaining the reason for the rejection diff --git a/buds/bud-02.md b/buds/bud-02.md index 6c04d25..5d6fe0a 100644 --- a/buds/bud-02.md +++ b/buds/bud-02.md @@ -8,7 +8,9 @@ A server MAY expose a `/process` endpoint for the purpose of processing and/or optimizing any blob the user uploads -The endpoint MUST accept the `Content-Type` of `multipart/form-data` with the field `blob` containing the raw binary of the blob being upload +Just like the `/upload` endpoint the `/process` endpoint MUST accept binary data in the body of the request and MAY use the `Content-Type` header to get the MIME type of the data + +The endpoint MUST also accept the `Content-Type` of `multipart/form-data` with the field `blob` containing the raw binary of the blob being upload Similar to the `/upload` endpoint the server MUST respond with a [Blob Descriptor](./bud-01.md#blob-descriptor)