MCPcopy Create free account
hub / github.com/buggregator/server / injectEventID

Function injectEventID

modules/sentry/handler.go:289–300  ·  view source on GitHub ↗

injectEventID adds "event_id" to a JSON payload that lacks it. Used to normalize Sentry SDK v4+ payloads which omit event_id from item bodies.

(payload json.RawMessage, eventID string)

Source from the content-addressed store, hash-verified

287// injectEventID adds "event_id" to a JSON payload that lacks it.
288// Used to normalize Sentry SDK v4+ payloads which omit event_id from item bodies.
289func injectEventID(payload json.RawMessage, eventID string) json.RawMessage {
290 var obj map[string]json.RawMessage
291 if err := json.Unmarshal(payload, &obj); err != nil {
292 return payload
293 }
294 obj["event_id"] = json.RawMessage(`"` + eventID + `"`)
295 result, err := json.Marshal(obj)
296 if err != nil {
297 return payload
298 }
299 return result
300}
301
302// decompress handles gzip and deflate Content-Encoding.
303// Also auto-detects gzip/zlib by magic bytes if header is missing.

Callers 1

handleEventItemMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected