mirror of
https://github.com/kataras/iris.git
synced 2025-02-02 15:30:36 +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
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
cType := fs.TypeByExtension(path)
|
|
||||||
fullpath := vdir + path
|
|
||||||
|
|
||||||
buf, err := assetFn(fullpath)
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
if modtimeStr == "" {
|
if modtimeStr == "" {
|
||||||
modtimeStr = modtime.UTC().Format(ctx.framework.Config.TimeFormat)
|
modtimeStr = modtime.UTC().Format(ctx.framework.Config.TimeFormat)
|
||||||
}
|
}
|
||||||
|
@ -1980,6 +1971,15 @@ func (api *muxAPI) StaticEmbedded(requestPath string, vdir string, assetFn func(
|
||||||
return
|
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(contentType, cType)
|
||||||
ctx.Response.Header.Set(lastModified, modtimeStr)
|
ctx.Response.Header.Set(lastModified, modtimeStr)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user