mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-15 13:02:14 +08:00
avoid 'multiple response.WriteHeader calls' error
This commit is contained in:
parent
4a6bc4aac4
commit
dd9b5d9106
@ -187,6 +187,7 @@ func (group *RouterGroup) createStaticHandler(relativePath string, fs http.FileS
|
||||
return func(c *Context) {
|
||||
if nolisting {
|
||||
c.Writer.WriteHeader(404)
|
||||
return
|
||||
}
|
||||
fileServer.ServeHTTP(c.Writer, c.Request)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user