Skip to content

Commit e07d65a

Browse files
committed
fix: add ResponseWriter to return value
1 parent 913e959 commit e07d65a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

middleware.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func RequestLoggingWithEcho(config *Config) echo.MiddlewareFunc {
109109
}
110110

111111
// SetContext for CloudFunctions
112-
func SetContext(config *Config, w http.ResponseWriter, r *http.Request) *http.Request {
112+
func SetContext(config *Config, w http.ResponseWriter, r *http.Request) (http.ResponseWriter, *http.Request) {
113113
before := time.Now()
114114

115115
traceId := getTraceId(r)
@@ -143,7 +143,8 @@ func SetContext(config *Config, w http.ResponseWriter, r *http.Request) *http.Re
143143
_, _ = fmt.Fprintln(os.Stderr, err.Error())
144144
}
145145
}()
146-
return r
146+
147+
return wrw, r
147148
}
148149

149150
func getTraceId(r *http.Request) string {

0 commit comments

Comments
 (0)