Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9e802c4fec | |||
| 9540d855e7 | |||
| 055f039b70 |
13
CHANGELOG.md
13
CHANGELOG.md
@@ -1,3 +1,16 @@
|
|||||||
|
# v3.1.1
|
||||||
|
|
||||||
|
## What's Changed
|
||||||
|
|
||||||
|
* Fixed crash caused by concurrent writes under high load ([#684](https://github.com/selfhst/icons/issues/684))
|
||||||
|
* Suppress favicon error log message when viewing icons directly from a browser
|
||||||
|
|
||||||
|
# v3.1.0
|
||||||
|
|
||||||
|
## What's Changed
|
||||||
|
|
||||||
|
* Updated logic to also replace gradient fills with custom colors when applicable
|
||||||
|
|
||||||
# v3.0.0
|
# v3.0.0
|
||||||
|
|
||||||
## Breaking Changes
|
## Breaking Changes
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
3.0.0
|
3.1.1
|
||||||
@@ -54,7 +54,6 @@ func (c *Cache) Get(key string) (string, bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if time.Since(item.Timestamp) > c.ttl {
|
if time.Since(item.Timestamp) > c.ttl {
|
||||||
delete(c.items, key)
|
|
||||||
return "", false
|
return "", false
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -170,6 +169,7 @@ func fetchRemoteFile(url string) (string, error) {
|
|||||||
func applySVGColor(svgContent, colorCode string) string {
|
func applySVGColor(svgContent, colorCode string) string {
|
||||||
color := "#" + colorCode
|
color := "#" + colorCode
|
||||||
|
|
||||||
|
// Replace fill:#fff
|
||||||
re1 := regexp.MustCompile(`style="[^"]*fill:\s*#fff[^"]*"`)
|
re1 := regexp.MustCompile(`style="[^"]*fill:\s*#fff[^"]*"`)
|
||||||
svgContent = re1.ReplaceAllStringFunc(svgContent, func(match string) string {
|
svgContent = re1.ReplaceAllStringFunc(svgContent, func(match string) string {
|
||||||
re2 := regexp.MustCompile(`fill:\s*#fff`)
|
re2 := regexp.MustCompile(`fill:\s*#fff`)
|
||||||
@@ -179,6 +179,16 @@ func applySVGColor(svgContent, colorCode string) string {
|
|||||||
re3 := regexp.MustCompile(`fill="#fff"`)
|
re3 := regexp.MustCompile(`fill="#fff"`)
|
||||||
svgContent = re3.ReplaceAllString(svgContent, `fill="`+color+`"`)
|
svgContent = re3.ReplaceAllString(svgContent, `fill="`+color+`"`)
|
||||||
|
|
||||||
|
// Replace stop-color:#fff in gradients
|
||||||
|
re4 := regexp.MustCompile(`style="[^"]*stop-color:\s*#fff[^"]*"`)
|
||||||
|
svgContent = re4.ReplaceAllStringFunc(svgContent, func(match string) string {
|
||||||
|
re5 := regexp.MustCompile(`stop-color:\s*#fff`)
|
||||||
|
return re5.ReplaceAllString(match, "stop-color:"+color)
|
||||||
|
})
|
||||||
|
|
||||||
|
re6 := regexp.MustCompile(`stop-color="#fff"`)
|
||||||
|
svgContent = re6.ReplaceAllString(svgContent, `stop-color="`+color+`"`)
|
||||||
|
|
||||||
return svgContent
|
return svgContent
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -419,6 +429,11 @@ func main() {
|
|||||||
|
|
||||||
mux.HandleFunc("GET /custom/{filename}", handleCustomIcon)
|
mux.HandleFunc("GET /custom/{filename}", handleCustomIcon)
|
||||||
|
|
||||||
|
// Suppress favicon load error message in logs when viewing via browser
|
||||||
|
mux.HandleFunc("GET /favicon.ico", func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
w.WriteHeader(http.StatusNoContent)
|
||||||
|
})
|
||||||
|
|
||||||
mux.HandleFunc("GET /{iconname}/{colorcode}", handleIcon)
|
mux.HandleFunc("GET /{iconname}/{colorcode}", handleIcon)
|
||||||
mux.HandleFunc("GET /{iconname}", handleIcon)
|
mux.HandleFunc("GET /{iconname}", handleIcon)
|
||||||
|
|
||||||
|
|||||||
6
renovate.json
Normal file
6
renovate.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||||
|
"extends": [
|
||||||
|
"config:recommended"
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user