Skip to content

Commit 68cdf9c

Browse files
authored
Merge pull request #51 from fiatjaf/fix/blossom-disabled-reject
Reject blossom uploads when blossom is disabled
2 parents 1c615a3 + 5dc3a1e commit 68cdf9c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

blossom/handler.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ func setupEnabled() {
7373
Server.DeleteBlob = deleteBlob
7474

7575
Server.RejectUpload = func(ctx context.Context, auth *nostr.Event, size int, ext string) (bool, string, int) {
76+
// the blossom routes stay registered on the main relay after a disable
77+
// (they can't be unregistered without a restart), so gate uploads here
78+
if !global.Settings.Blossom.Enabled {
79+
return true, "blossom is disabled", 403
80+
}
7681
if auth == nil {
7782
return true, "authentication required", 401
7883
}

0 commit comments

Comments
 (0)