bugsnag / bugsnag-go

Automatic panic monitoring for Go and Go web frameworks, like negroni, gin, and revel
https://docs.bugsnag.com/platforms/go
MIT License
204 stars 69 forks source link

Fix middleware panic on nil *http.Request #212

Closed DariaKunoichi closed 8 months ago

DariaKunoichi commented 8 months ago

Goal

One of the two default OnBeforeNotify callbacks was panicking if http request in Event's RawData was nil. Check for nil request added (https://github.com/bugsnag/bugsnag-go/pull/210).

Design

-

Changeset

Added check for nil http.Request in httpRequestMiddleware callback.

Testing

Added unit tests for nil request scenario.