Skip to content
This repository has been archived by the owner on Oct 27, 2023. It is now read-only.

fix: 修复kratos的context传递到gin丢失的问题 #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions gin.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func Middlewares(m ...middleware.Middleware) gin.HandlerFunc {
chain := middleware.Chain(m...)
return func(c *gin.Context) {
next := func(ctx context.Context, req interface{}) (interface{}, error) {
c.Request = c.Request.WithContext(ctx)
c.Next()
var err error
if c.Writer.Status() >= http.StatusBadRequest {
Expand Down