mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-22 01:12:16 +08:00
Forgot to do go-fmt. My apologies
This commit is contained in:
parent
0fbf6d2438
commit
dd10eee09f
@ -185,10 +185,10 @@ func (group *RouterGroup) StaticFS(relativePath string, fs http.FileSystem) IRou
|
||||
func (group *RouterGroup) createStaticHandler(relativePath string, fs http.FileSystem) HandlerFunc {
|
||||
absolutePath := group.calculateAbsolutePath(relativePath)
|
||||
fileServer := http.StripPrefix(absolutePath, http.FileServer(fs))
|
||||
|
||||
|
||||
return func(c *Context) {
|
||||
file := c.Param("filepath")
|
||||
|
||||
|
||||
// Check if file exists or if we have permission to access it
|
||||
if _, err := fs.Open(file); err != nil {
|
||||
c.Writer.WriteHeader(http.StatusNotFound)
|
||||
|
Loading…
x
Reference in New Issue
Block a user