mirror of
https://github.com/kataras/iris.git
synced 2025-01-23 10:41:03 +01:00
StaticEmbedded: Do the actual work if cache duration passed
For StaticEmbedded example take a look at the HISTORY.md file
This commit is contained in:
parent
1a913d45d4
commit
9bbbbf6769
18
iris.go
18
iris.go
|
@ -1960,15 +1960,6 @@ func (api *muxAPI) StaticEmbedded(requestPath string, vdir string, assetFn func(
|
|||
continue
|
||||
}
|
||||
|
||||
cType := fs.TypeByExtension(path)
|
||||
fullpath := vdir + path
|
||||
|
||||
buf, err := assetFn(fullpath)
|
||||
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
|
||||
if modtimeStr == "" {
|
||||
modtimeStr = modtime.UTC().Format(ctx.framework.Config.TimeFormat)
|
||||
}
|
||||
|
@ -1980,6 +1971,15 @@ func (api *muxAPI) StaticEmbedded(requestPath string, vdir string, assetFn func(
|
|||
return
|
||||
}
|
||||
|
||||
cType := fs.TypeByExtension(path)
|
||||
fullpath := vdir + path
|
||||
|
||||
buf, err := assetFn(fullpath)
|
||||
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
|
||||
ctx.Response.Header.Set(contentType, cType)
|
||||
ctx.Response.Header.Set(lastModified, modtimeStr)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user