Skip to content

Commit

Permalink
Merge pull request #1069 from kiyonlin/patch-static-config
Browse files Browse the repository at this point in the history
👷 Remove redundant validation of CacheDuration when checking static config
  • Loading branch information
Fenny authored Dec 10, 2020
2 parents a84733d + a5a50ab commit e198b10
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions router.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,7 @@ func (app *App) registerStatic(prefix, root string, config ...Static) Router {
if maxAge > 0 {
cacheControlValue = "public, max-age=" + strconv.Itoa(maxAge)
}
if config[0].CacheDuration != 0 {
fs.CacheDuration = config[0].CacheDuration
}
fs.CacheDuration = config[0].CacheDuration
fs.Compress = config[0].Compress
fs.AcceptByteRange = config[0].ByteRange
fs.GenerateIndexPages = config[0].Browse
Expand Down

0 comments on commit e198b10

Please sign in to comment.