Skip to content

Commit

Permalink
Add missing response info
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurfranca committed May 21, 2023
1 parent d6d0711 commit cddb7a0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions 95.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ The `filename` embedded in the file may not be honored by the relay, which can i
Relays must reject the upload if the `payload` tag value contains an already used SHA-256 hash or
it isn't the same of the received file.

The upload response is a json as follows:

```js
{
nip95: {
Expand Down Expand Up @@ -72,16 +74,18 @@ This is done to assure the same file hash result, no matter to how many relays o

## Download

Relays must make available the route path `nip95/<sha256-file-hash>` with `GET` method for file download.
Relays must make available the route path `/nip95/<sha256-file-hash>` with `GET` method for file download.

Clients should send a `GET` request to the relay url in the format `https://relay.domain/nip95/<sha256-file-hash>?r=relay.domain2&r=relay.domain3`.

If the relay doesn't have the file anymore, it should issue a 302 http redirect to the next relay included as `r` query param. For example, issue a redirect to `https://relay.domain2/nip95/<sha256-file-hash>?r=relay.domain3`

## Deletion

Relays must make available the route path `nip95/<sha256-file-hash>` with `DELETE` method for file deletion.
Relays must make available the route path `/nip95/<sha256-file-hash>` with `DELETE` method for file deletion.

Clients should send a `DELETE` request to the relay url in the format `https://relay.domain/nip95/<sha256-file-hash>`. It must include a NIP-98 `Authorization` header.

The relay should reject deletes from users other than the original uploader.

The response is similar to the json sent on uploads.

0 comments on commit cddb7a0

Please sign in to comment.