mirror of
https://github.com/gin-gonic/gin.git
synced 2025-04-06 03:57:46 +08:00
Merge 040a2c3e00708c9d3bbf2c5c5bcd8b37a7a70d16 into 8763f33c65f7df8be5b9fe7504ab7fcf20abb41d
This commit is contained in:
commit
c34065fcb1
@ -224,7 +224,7 @@ func (group *RouterGroup) createStaticHandler(relativePath string, fs http.FileS
|
|||||||
|
|
||||||
file := c.Param("filepath")
|
file := c.Param("filepath")
|
||||||
// Check if file exists and/or if we have permission to access it
|
// Check if file exists and/or if we have permission to access it
|
||||||
f, err := fs.Open(file)
|
f, err := fs.Open(path.Clean(file))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.Writer.WriteHeader(http.StatusNotFound)
|
c.Writer.WriteHeader(http.StatusNotFound)
|
||||||
c.handlers = group.engine.noRoute
|
c.handlers = group.engine.noRoute
|
||||||
|
Loading…
x
Reference in New Issue
Block a user