From 83896f83949d1d943f28740b097188af5aa3aa86 Mon Sep 17 00:00:00 2001 From: hzrd149 Date: Wed, 20 Mar 2024 08:34:16 -0500 Subject: [PATCH] add HEAD /sha256 endpoint for checking blobs --- Nostr.md | 2 +- README.md | 1 + Server.md | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Nostr.md b/Nostr.md index 43de7ae..8a6b662 100644 --- a/Nostr.md +++ b/Nostr.md @@ -6,7 +6,7 @@ See [Authorization events](./Server.md#authorization-events) ## 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 diff --git a/README.md b/README.md index f77b99f..54ae935 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ Blobs are packs of binary data addressed by their sha256 hash Blossom Servers expose four endpoints for managing blobs - `GET /` (optional file `.ext`) +- `HEAD /` (optional file `.ext`) - `PUT /upload` - `Authentication`: Signed [nostr event](./Server.md#upload-authorization-required) - Return a blob descriptor diff --git a/Server.md b/Server.md index 8b14460..b4a5086 100644 --- a/Server.md +++ b/Server.md @@ -105,6 +105,12 @@ Example Authorization event: } ``` +### HEAD /sha256 - Has Blob + +The `HEAD /` 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 /` endpoint. ie. `.pdf`, `.png`, etc + ### 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.