Written to derive DSN keys from requests forwarded from an on premise Sentry (8.13).
import sentrydsn "github.com/sentry-demos/sentrydsn"
//some request handler
func myFunc(r *http.Request){
dsn, err := sentrydsn.FromRequest(r)
if err != nil {
//handle err
}
//check dsn length/ other logic
myDSN := dsn.URL
if len(myDSN) == 0{
//handle
}
//return myDSN
}
go test --v
- Currently requests sent to the legacy /api/store/ as opposed to /api/{projectID}/store/ will return a DSN struct with URL as empty ""
- Module will currently not handle forwarded requests to the sentry API: /api/0/
- Module does not rewrite auth headers.