add HEAD /sha256 endpoint for checking blobs

This commit is contained in:
hzrd149 2024-03-20 08:34:16 -05:00
parent 4eb73b01b7
commit 83896f8394
3 changed files with 8 additions and 1 deletions

View File

@ -6,7 +6,7 @@ See [Authorization events](./Server.md#authorization-events)
## User Server Discovery ## User Server Discovery
Users should publish a kind `10063` event with a list of `r` tags indicating servers that others users should use when getting their blobs Users should publish a kind `10063` event with a list of ordered `r` tags indicating servers that others users should use when getting their blobs
### Example ### Example

View File

@ -15,6 +15,7 @@ Blobs are packs of binary data addressed by their sha256 hash
Blossom Servers expose four endpoints for managing blobs Blossom Servers expose four endpoints for managing blobs
- `GET /<sha256>` (optional file `.ext`) - `GET /<sha256>` (optional file `.ext`)
- `HEAD /<sha256>` (optional file `.ext`)
- `PUT /upload` - `PUT /upload`
- `Authentication`: Signed [nostr event](./Server.md#upload-authorization-required) - `Authentication`: Signed [nostr event](./Server.md#upload-authorization-required)
- Return a blob descriptor - Return a blob descriptor

View File

@ -105,6 +105,12 @@ Example Authorization event:
} }
``` ```
### HEAD /sha256 - Has Blob
The `HEAD /<sha256>` endpoint MUST respond with either a `200` or `404` status code
The endpoint MUST accept an optional file extension in the URL similar to the `GET /<sha256>` endpoint. ie. `.pdf`, `.png`, etc
### PUT /upload - Upload Blob ### 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 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.