summaryrefslogtreecommitdiffstats
path: root/internal/handler/websocket/handler.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/handler/websocket/handler.go')
-rw-r--r--internal/handler/websocket/handler.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/internal/handler/websocket/handler.go b/internal/handler/websocket/handler.go
index dfe7b9e..909e2ec 100644
--- a/internal/handler/websocket/handler.go
+++ b/internal/handler/websocket/handler.go
@@ -348,7 +348,12 @@ func (h *Handler) handleEvent(ctx context.Context, conn *websocket.Conn, raw []j
348 348
349 h.subs.MatchAndFan(pbEvent) 349 h.subs.MatchAndFan(pbEvent)
350 350
351 status = "ok" 351 // Track whether request was authenticated for metrics
352 if state.authenticatedPubkey != "" {
353 status = "authorized"
354 } else {
355 status = "ok"
356 }
352 h.sendOK(ctx, conn, event.ID, true, "") 357 h.sendOK(ctx, conn, event.ID, true, "")
353 return nil 358 return nil
354} 359}
@@ -448,7 +453,12 @@ func (h *Handler) handleReq(ctx context.Context, conn *websocket.Conn, raw []jso
448 453
449 go h.streamEvents(ctx, conn, sub) 454 go h.streamEvents(ctx, conn, sub)
450 455
451 status = "ok" 456 // Track whether request was authenticated for metrics
457 if state.authenticatedPubkey != "" {
458 status = "authorized"
459 } else {
460 status = "ok"
461 }
452 return nil 462 return nil
453} 463}
454 464