Actually, this still doesn’t completely give the right results. I played around with which property and request object to use. I found that Sentry would complain about an invalid attribute and would not capture the body in some cases.
None of these was a perfect solution. Here’s the outcome I found depending on which one I uncomment:
// req: this.request, // Sentry captures body, but flags this as an invalid attribute
// request: this.req, // No body, no invalid attribute error
// req: this.req, //No body, no invalid attribute error
// request: this.request, //No body, no invalid attribute error
req: this.request yielded the best result, just has an irritating message saying it’s invalid.
This also results in the url that is captured is not quite right, it’s good enough for debugging though.