avoid 'multiple response.WriteHeader calls' error

This commit is contained in:
Harmen 2016-03-31 17:14:22 +02:00
parent 4a6bc4aac4
commit dd9b5d9106

View File

@ -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)
} }