You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're using Gorillamux and net/http and ran into an issue where the Sentry handler consumes the request body, which makes int unavailable for later handlers/middleware to use.
Steps To Reproduce
I don't have a fully reproducible code path, but rough outline:
router.HandleFunc("/some/path", PathHandler())
varsentryHandler=sentryhttp.New(sentryhttp.Options{
Repanic: true,
WaitForDelivery: false,
})
funcAuthUser() func(http.ResponseWriter, *http.Request) {
returnsentryHandler.handleFunc(func(rw http.ResponseWriter, r*http.Request) {
r.ParseForm()
someForm:=r.FormValue("formKey")
// someForm is blank and the parseForm will be empty because the body has been consumed
})
}
When removing the sentry handler, the request form can be read as normal.
Expected Behavior
Later handler functions are able to use the body on the original request without having to pre-cache or otherwise get the body before the Sentry handler is used.
Screenshots
Sentry.io Event
n/a
Environment
SDK
sentry-go version: 0.27
Go version: 1.22.1
Using Go Modules? yes
Sentry
Using hosted Sentry in sentry.io? yes
Using your own Sentry installation? Version: n/a
Anything particular to your environment that could be related to this issue?
Additional context
The text was updated successfully, but these errors were encountered:
Summary
We're using Gorillamux and net/http and ran into an issue where the Sentry handler consumes the request body, which makes int unavailable for later handlers/middleware to use.
Steps To Reproduce
I don't have a fully reproducible code path, but rough outline:
When removing the sentry handler, the request form can be read as normal.
Expected Behavior
Later handler functions are able to use the body on the original request without having to pre-cache or otherwise get the body before the Sentry handler is used.
Screenshots
Sentry.io Event
n/a
Environment
SDK
sentry-go
version: 0.27Sentry
Additional context
The text was updated successfully, but these errors were encountered: