mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-16 05:16:35 +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) {
|
return func(c *Context) {
|
||||||
if nolisting {
|
if nolisting {
|
||||||
c.Writer.WriteHeader(404)
|
c.Writer.WriteHeader(404)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
fileServer.ServeHTTP(c.Writer, c.Request)
|
fileServer.ServeHTTP(c.Writer, c.Request)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user