Skip to content

Commit

Permalink
Move ResponseWriter wrapper to internal (#880)
Browse files Browse the repository at this point in the history
* move ResponseWriter middleware to internal

* move ResponseWriter middleware to internal
  • Loading branch information
ribice authored Sep 4, 2024
1 parent 24ffea5 commit 871a366
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion http/sentryhttp.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"time"

"github.com/getsentry/sentry-go"
"github.com/getsentry/sentry-go/internal/httputils"
"github.com/getsentry/sentry-go/internal/traceutils"
)

Expand Down Expand Up @@ -107,7 +108,7 @@ func (h *Handler) handle(handler http.Handler) http.HandlerFunc {
)
transaction.SetData("http.request.method", r.Method)

rw := sentry.NewWrapResponseWriter(w, r.ProtoMajor)
rw := httputils.NewWrapResponseWriter(w, r.ProtoMajor)

defer func() {
status := rw.Status()
Expand Down
2 changes: 1 addition & 1 deletion wrap_writer.go → internal/httputils/wrap_writer.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sentry
package httputils

import (
"bufio"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sentry
package httputils

import (
"bufio"
Expand Down
3 changes: 2 additions & 1 deletion negroni/sentrynegroni.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"time"

"github.com/getsentry/sentry-go"
"github.com/getsentry/sentry-go/internal/httputils"
"github.com/getsentry/sentry-go/internal/traceutils"
"github.com/urfave/negroni"
)
Expand Down Expand Up @@ -69,7 +70,7 @@ func (h *handler) ServeHTTP(w http.ResponseWriter, r *http.Request, next http.Ha
)

transaction.SetData("http.request.method", r.Method)
rw := sentry.NewWrapResponseWriter(w, r.ProtoMajor)
rw := httputils.NewWrapResponseWriter(w, r.ProtoMajor)

defer func() {
status := rw.Status()
Expand Down

0 comments on commit 871a366

Please sign in to comment.