stats icon indicating copy to clipboard operation
stats copied to clipboard

wrong status code of middleware

Open cgyy opened this issue 9 years ago • 0 comments

the example of gin should be:

// StatMiddleware response time, status code count, etc.
func StatMiddleware() gin.HandlerFunc {
    return func(c *gin.Context) {
        beginning, _ := Stats.Begin(c.Writer)
        c.Next()
        Stats.EndWithStatus(beginning, c.Writer.Status())
    }
}

the example of martini has same issue

cgyy avatar Aug 17 '16 07:08 cgyy