@@ -81,7 +81,7 @@ public function getThemedIcon(string $app, string $image): Response {
8181 * Return a 32x32 favicon as png
8282 *
8383 * @param string $app ID of the app
84- * @return DataDisplayResponse<Http::STATUS_OK, array{Content-Type: 'image/png'}>|FileDisplayResponse<Http::STATUS_OK, array{Content-Type: string }>|NotFoundResponse<Http::STATUS_NOT_FOUND, array{}>
84+ * @return DataDisplayResponse<Http::STATUS_OK, array{Content-Type: 'image/png'}>|FileDisplayResponse<Http::STATUS_OK, array{Content-Type: 'image/x-icon' }>|NotFoundResponse<Http::STATUS_NOT_FOUND, array{}>
8585 * @throws \Exception
8686 *
8787 * 200: Favicon returned
@@ -100,11 +100,11 @@ public function getFavicon(string $app = 'core'): Response {
100100 // retrieve instance favorite icon
101101 try {
102102 $ iconFile = $ this ->imageManager ->getImage ('favicon ' , false );
103- $ response = new FileDisplayResponse ($ iconFile , Http::STATUS_OK , ['Content-Type ' => $ iconFile -> getMimeType () ]);
103+ $ response = new FileDisplayResponse ($ iconFile , Http::STATUS_OK , ['Content-Type ' => ' image/x-icon ' ]);
104104 } catch (NotFoundException $ e ) {
105105 }
106106 // retrieve or generate app specific favorite icon
107- if ($ this ->imageManager ->canConvert ('PNG ' )) {
107+ if (( $ this ->imageManager ->canConvert ('PNG ' ) || $ this -> imageManager -> canConvert ( ' SVG ' )) && $ this -> imageManager -> canConvert ( ' ICO ' )) {
108108 $ color = $ this ->themingDefaults ->getColorPrimary ();
109109 try {
110110 $ iconFile = $ this ->imageManager ->getCachedImage ('favIcon- ' . $ app . $ color );
@@ -115,7 +115,7 @@ public function getFavicon(string $app = 'core'): Response {
115115 }
116116 $ iconFile = $ this ->imageManager ->setCachedImage ('favIcon- ' . $ app . $ color , $ icon );
117117 }
118- $ response = new FileDisplayResponse ($ iconFile , Http::STATUS_OK , ['Content-Type ' => 'image/png ' ]);
118+ $ response = new FileDisplayResponse ($ iconFile , Http::STATUS_OK , ['Content-Type ' => 'image/x-icon ' ]);
119119 }
120120 // fallback to core favorite icon
121121 if ($ response === null ) {
0 commit comments