From c6eb79133c5747b863ec98fa748436ac16bca6d3 Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Thu, 18 Jan 2024 08:18:26 +0100 Subject: [PATCH] Add missing Clone, fix comments --- federationapi/routing/routing.go | 2 ++ internal/httputil/httpapi.go | 2 +- relayapi/routing/routing.go | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/federationapi/routing/routing.go b/federationapi/routing/routing.go index dc7a363e7..6328d165e 100644 --- a/federationapi/routing/routing.go +++ b/federationapi/routing/routing.go @@ -647,6 +647,8 @@ func MakeFedAPI( // add the user to Sentry, if enabled hub := sentry.GetHubFromContext(req.Context()) if hub != nil { + // clone the hub, so we don't send garbage events with e.g. mismatching rooms/event_ids + hub = hub.Clone() hub.Scope().SetTag("origin", string(fedReq.Origin())) hub.Scope().SetTag("uri", fedReq.RequestURI()) } diff --git a/internal/httputil/httpapi.go b/internal/httputil/httpapi.go index 76081355e..c78aadf89 100644 --- a/internal/httputil/httpapi.go +++ b/internal/httputil/httpapi.go @@ -76,7 +76,7 @@ func MakeAuthAPI( // add the user to Sentry, if enabled hub := sentry.GetHubFromContext(req.Context()) if hub != nil { - // clone the hub, so we don't sent garbage events with e.g. mismatching rooms/event_ids + // clone the hub, so we don't send garbage events with e.g. mismatching rooms/event_ids hub = hub.Clone() hub.Scope().SetUser(sentry.User{ Username: device.UserID, diff --git a/relayapi/routing/routing.go b/relayapi/routing/routing.go index b1ce1ef10..92476d6c2 100644 --- a/relayapi/routing/routing.go +++ b/relayapi/routing/routing.go @@ -108,7 +108,7 @@ func MakeRelayAPI( // add the user to Sentry, if enabled hub := sentry.GetHubFromContext(req.Context()) if hub != nil { - // clone the hub, so we don't sent garbage events with e.g. mismatching rooms/event_ids + // clone the hub, so we don't send garbage events with e.g. mismatching rooms/event_ids hub = hub.Clone() hub.Scope().SetTag("origin", string(fedReq.Origin())) hub.Scope().SetTag("uri", fedReq.RequestURI())