mirror of
https://github.com/miniflux/v2.git
synced 2025-08-01 17:38:37 +00:00
Add application icons
This commit is contained in:
parent
1d8193b892
commit
231ebf2daa
12 changed files with 63 additions and 8 deletions
|
@ -43,3 +43,23 @@ func (c *Controller) Favicon(ctx *core.Context, request *core.Request, response
|
|||
|
||||
response.Cache("image/x-icon", static.BinariesChecksums["favicon.ico"], blob, 48*time.Hour)
|
||||
}
|
||||
|
||||
// AppIcon returns application icons.
|
||||
func (c *Controller) AppIcon(ctx *core.Context, request *core.Request, response *core.Response) {
|
||||
filename := request.StringParam("filename", "favicon.png")
|
||||
encodedBlob, found := static.Binaries[filename]
|
||||
if !found {
|
||||
logger.Info("[Controller:AppIcon] This icon doesn't exists: %s", filename)
|
||||
response.HTML().NotFound()
|
||||
return
|
||||
}
|
||||
|
||||
blob, err := base64.StdEncoding.DecodeString(encodedBlob)
|
||||
if err != nil {
|
||||
logger.Error("[Controller:AppIcon] %v", err)
|
||||
response.HTML().NotFound()
|
||||
return
|
||||
}
|
||||
|
||||
response.Cache("image/png", static.BinariesChecksums[filename], blob, 48*time.Hour)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue