diff options
author | Gabe Kangas <gabek@real-ity.com> | 2022-01-13 20:49:28 -0800 |
---|---|---|
committer | Gabe Kangas <gabek@real-ity.com> | 2022-01-13 20:49:28 -0800 |
commit | 9226e783ff5772338abe8cf3a80d87431fc78a1d (patch) | |
tree | d40d82d284bbcab41868fd6562df21ffec1a65bd | |
parent | 6545a9573e7a1a04fa5b8300801b30636ed25b9a (diff) |
Only warn about svg logo once. Closes #1668
-rw-r--r-- | controllers/logo.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/controllers/logo.go b/controllers/logo.go index dd29fcee5..149c8dc98 100644 --- a/controllers/logo.go +++ b/controllers/logo.go @@ -12,6 +12,8 @@ import ( log "github.com/sirupsen/logrus" ) +var _hasWarnedSVGLogo = false + // GetLogo will return the logo image as a response. func GetLogo(w http.ResponseWriter, r *http.Request) { imageFilename := data.GetLogoPath() @@ -69,7 +71,10 @@ func GetCompatibleLogo(w http.ResponseWriter, r *http.Request) { if referrer == "" { referrer = "an external site" } - log.Warnf("%s requested your logo. because many social networks do not support SVGs we returned a placeholder instead. change your current logo \"%s\" to a png or jpeg to be most compatible with external social networking sites.", referrer, imageFilename) + if !_hasWarnedSVGLogo { + log.Warnf("%s requested your logo. because many social networks do not support SVGs we returned a placeholder instead. change your current logo to a png or jpeg to be most compatible with external social networking sites.", referrer) + _hasWarnedSVGLogo = true + } } func returnDefault(w http.ResponseWriter) { |