Minimal linting improvements

This commit is contained in:
2022-02-20 21:19:28 +00:00
parent 545f223a97
commit c03d16878a
10 changed files with 23 additions and 17 deletions

View File

@ -104,7 +104,11 @@ func (h *Handler) ServeStaticFile(c *gin.Context, fullPath string) {
return
}
http.ServeContent(c.Writer, c.Request, stat.Name(), stat.ModTime(), file.(io.ReadSeeker))
if file, ok := file.(io.ReadSeeker); ok {
http.ServeContent(c.Writer, c.Request, stat.Name(), stat.ModTime(), file)
} else {
panic("File does not implement ReadSeeker")
}
}
func enableCachingForStaticFiles() gin.HandlerFunc {