feat: add support for custom favicons (#4770)
* feat: add support for custom favicons * Commit updated API documentation * chore(i18n): add localization of text * fix(js): regenerate package lock file * chore(test): add favicon test * fix: max size not respected * Commit updated API documentation * fix: move favicon.ico to the static dir * fix: fix tests * fix: remove hard-coded content-type of icon * chore: update extracted translations * feat(admin): add support for resetting to default icon * chore: use a higher res default favicon * Commit updated API documentation --------- Co-authored-by: Owncast <owncast@owncast.online>
This commit is contained in:
@@ -33,6 +33,7 @@ func RequireAdminAuth(handler http.HandlerFunc) http.HandlerFunc {
|
||||
w.Header().Set("Access-Control-Allow-Origin", validAdminHost)
|
||||
w.Header().Set("Access-Control-Allow-Credentials", "true")
|
||||
w.Header().Set("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Authorization")
|
||||
w.Header().Set("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS")
|
||||
|
||||
// For request needing CORS, send a 204.
|
||||
if r.Method == "OPTIONS" {
|
||||
|
||||
@@ -108,6 +108,7 @@ func addStaticFileEndpoints(r chi.Router) {
|
||||
r.HandleFunc("/thumbnail.jpg", handlers.GetThumbnail)
|
||||
r.HandleFunc("/preview.gif", handlers.GetPreview)
|
||||
r.HandleFunc("/logo", handlers.GetLogo)
|
||||
r.HandleFunc("/favicon.ico", handlers.GetFavicon)
|
||||
// return a logo that's compatible with external social networks
|
||||
r.HandleFunc("/logo/external", handlers.GetCompatibleLogo)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user