pbrisbin / bugsnag-haskell

Bugsnag error reporter for Haskell
10 stars 7 forks source link

Move request header redacting #46

Closed pbrisbin closed 5 years ago

pbrisbin commented 5 years ago

In the main notify routine, the before-notify composition places the most local function (the one passed directly to notifyWith) last in the change, after the one coming from Settings. To do otherwise could be surprising.

Since updateEventFromWaiRequest is almost-certainly used as an argument to notifyWith, it sets the Event Request /after/ the Settings hook has run. Therefore, placing the header redaction as a default in Settings in an effort to ensure it always runs was misguided: it has no effect.

This change moves the redaction into the before-notify dealing with the WAI Request itself:

Fixes #31 for real.

NOTE: we really should have a way to put a regression test on this.

pbrisbin commented 5 years ago

Ping @MaxGabriel

MaxGabriel commented 5 years ago

This approach makes sense to me @pbrisbin