gin-contrib / timeout

Timeout middleware for Gin
MIT License
185 stars 38 forks source link

Combined http results #7

Closed hongbo-miao closed 2 years ago

hongbo-miao commented 3 years ago

I have a very simple Gin server.

func Health(c *gin.Context) {
    c.JSON(http.StatusOK, gin.H{
        "status": "ok",
    })
}

r := gin.Default()
r.GET("/", timeout.New(
    timeout.WithTimeout(1000*time.Microsecond),
    timeout.WithHandler(controllers.Health),
))
err := r.Run(":" + config.Port)

However, if I click multiple times, sometimes I will get results like with previous call results and be combined together:

image

And sometimes not.

Any idea? Thanks

appleboy commented 2 years ago

Fixed in #13