diff --git a/buds/01.md b/buds/01.md index 5d5434f..41466bb 100644 --- a/buds/01.md +++ b/buds/01.md @@ -36,7 +36,7 @@ Authorization events MAY have multiple `x` tags for endpoints that require a sha Example event: -```json +```jsonc { "id": "bb653c815da18c089f3124b41c4b5ec072a40b87ca0f50bbbc6ecde9aca442eb", "pubkey": "b53185b9f27962ebdf76b8a9b0a84cd8b27f9f3d4abd59f715788a3bf9e7f75e", @@ -45,7 +45,7 @@ Example event: "created_at": 1708773959, "tags": [ ["t", "upload"], - // Authorization events MAY have multiple "x" tags + // Authorization events MAY have multiple "x" tags. ["x", "b1674191a88ec5cdd733e4240a81803105dc412d6c6708d53ab94fc248f4f553"], ["expiration", "1708858680"] ], @@ -71,22 +71,22 @@ Authorization: Nostr eyJpZCI6IjhlY2JkY2RkNTMyOTIwMDEwNTUyNGExNDI4NzkxMzg4MWIzOWQ ## Endpoints -All endpoints MUST be served from the root of the domain (eg. the `/upload` endpoint MUST accessible from `https://cdn.example.com/upload`, etc). This allows clients to talk to servers interchangeably when uploading or retrieving blobs +All endpoints MUST be served from the root of the domain (eg. the `/upload` endpoint MUST be accessible from `https://cdn.example.com/upload`, etc). This allows clients to talk to servers interchangeably when uploading or retrieving blobs ## GET /sha256 - Get Blob -The `GET /` endpoint MUST return the contents of the blob with the `Content-Type` header set to the appropriate MIME type +The `GET /` endpoint MUST return the contents of the blob with the `Content-Type` header set to the appropriate MIME-type The endpoint MUST accept an optional file extension in the URL. ie. `.pdf`, `.png`, etc -If the endpoints returns a 301 or 302 redirect it MUST redirect to a URL containing the same sha256 hash as requested blob. +If the endpoints returns a 301 or 302 redirect it MUST redirect to a URL containing the same sha256 hash as the requested blob. This ensures that if a user was to copy or reuse the redirect URL it would still contain the original sha256 hash ### Get Authorization (optional) The server may optionally require authorization when retrieving blobs from the `GET /` endpoint -In this case the server MUST perform additional checks on the authorization event +In this case, the server MUST perform additional checks on the authorization event 1. A `t` tag MUST be present and set to `get` 2. The event MUST contain either a `server` tag containing the full URL to the server or MUST contain at least one `x` tag matching the sha256 hash of the blob being retrieved diff --git a/buds/04.md b/buds/04.md index 92559c0..eb1d19f 100644 --- a/buds/04.md +++ b/buds/04.md @@ -12,8 +12,8 @@ A server may expose a `PUT /mirror` endpoint to allow users to copy a blob from Clients MUST pass the URL of the remote blob as a stringified JSON object in the request body -```json -// request body +```jsonc +// request body... { "url": "https://cdn.satellite.earth/b1674191a88ec5cdd733e4240a81803105dc412d6c6708d53ab94fc248f4f553.pdf" }