Browse Source

fix bug

tags/v0.5.5
Lunny Xiao 1 year ago
parent
commit
ff8395e067
Signed by: lunny <xiaolunwen@gmail.com> GPG Key ID: C3B7C91B632F738A
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      static.go

+ 3
- 0
static.go View File

@@ -135,14 +135,17 @@ func Static(opts ...StaticOptions) HandlerFunc {
} else {
finfo, err = fi.Stat()
if err != nil {
fi.Close()
ctx.Result = InternalServerError(err.Error())
ctx.HandleError()
return
}
if !finfo.IsDir() {
http.ServeContent(ctx, ctx.Req(), finfo.Name(), finfo.ModTime(), fi)
fi.Close()
return
}
fi.Close()
}
}
}


Loading…
Cancel
Save