sentry-go
sentry-go copied to clipboard
fix: input validation to NewRequest
Fixes panic: runtime error: invalid memory address or nil pointer dereference when passing http.Request that has not defined r.Host or r.URL.Path or even just nil in general.
req := &http.Request{}
sentry.NewRequest(req)
- This adds an error signature onto
NewRequestandentryToEvent - Tests have been added to cover error handling
This is a breaking change, as it changes the signature of NewRequest. I assume that's used externally (as it's public/exposed). The added validation doesn't seem worthy of a breaking change.