We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let me simplify the code
package main import ( "net/http" "time" "github.com/gin-contrib/timeout" "github.com/gin-gonic/gin" ) func timeoutMiddleware() gin.HandlerFunc { return timeout.New( timeout.WithTimeout(500*time.Millisecond), timeout.WithHandler(func(c *gin.Context) { c.Next() }), timeout.WithResponse(func(c *gin.Context) { c.String(http.StatusRequestTimeout, "timeout") }), ) } func main() { gin.SetMode(gin.ReleaseMode) r := gin.New() r.Use(timeoutMiddleware()) r.Static("/log", "./") r.Run(":8888") }
When i try to get http://localhost:8888/log/go.sum i can get correct file content in response body but http status code is 404
go version go1.21.5 linux/amd64
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Let me simplify the code
When i try to get http://localhost:8888/log/go.sum
i can get correct file content in response body but http status code is 404
go version go1.21.5 linux/amd64
The text was updated successfully, but these errors were encountered: