@@ -97,10 +97,10 @@ public function getFavicon(string $app = 'core'): Response {
9797 $ iconFile = null ;
9898 try {
9999 $ iconFile = $ this ->imageManager ->getImage ('favicon ' , false );
100- $ response = new FileDisplayResponse ($ iconFile , Http::STATUS_OK , ['Content-Type ' => ' image/x-icon ' ]);
100+ $ response = new FileDisplayResponse ($ iconFile , Http::STATUS_OK , ['Content-Type ' => $ iconFile -> getMimeType () ]);
101101 } catch (NotFoundException $ e ) {
102102 }
103- if ($ iconFile === null && $ this ->imageManager ->canConvert ('PNG ' )) {
103+ if ($ iconFile === null && ( $ this ->imageManager ->canConvert ('SVG ' ) || $ this -> imageManager -> canConvert ( ' PNG ') )) {
104104 $ color = $ this ->themingDefaults ->getColorPrimary ();
105105 try {
106106 $ iconFile = $ this ->imageManager ->getCachedImage ('favIcon- ' . $ app . $ color );
@@ -111,11 +111,11 @@ public function getFavicon(string $app = 'core'): Response {
111111 }
112112 $ iconFile = $ this ->imageManager ->setCachedImage ('favIcon- ' . $ app . $ color , $ icon );
113113 }
114- $ response = new FileDisplayResponse ($ iconFile , Http::STATUS_OK , ['Content-Type ' => ' image/x-icon ' ]);
114+ $ response = new FileDisplayResponse ($ iconFile , Http::STATUS_OK , ['Content-Type ' => $ iconFile -> getMimeType () ]);
115115 }
116116 if ($ response === null ) {
117117 $ fallbackLogo = \OC ::$ SERVERROOT . '/core/img/favicon.png ' ;
118- $ response = new DataDisplayResponse ($ this ->fileAccessHelper ->file_get_contents ($ fallbackLogo ), Http::STATUS_OK , ['Content-Type ' => 'image/x-icon ' ]);
118+ $ response = new DataDisplayResponse ($ this ->fileAccessHelper ->file_get_contents ($ fallbackLogo ), Http::STATUS_OK , ['Content-Type ' => 'image/png ' ]);
119119 }
120120 $ response ->cacheFor (86400 );
121121 return $ response ;
@@ -142,10 +142,10 @@ public function getTouchIcon(string $app = 'core'): Response {
142142 $ response = null ;
143143 try {
144144 $ iconFile = $ this ->imageManager ->getImage ('favicon ' );
145- $ response = new FileDisplayResponse ($ iconFile , Http::STATUS_OK , ['Content-Type ' => ' image/x-icon ' ]);
145+ $ response = new FileDisplayResponse ($ iconFile , Http::STATUS_OK , ['Content-Type ' => $ iconFile -> getMimeType () ]);
146146 } catch (NotFoundException $ e ) {
147147 }
148- if ($ this ->imageManager ->canConvert ('PNG ' )) {
148+ if ($ this ->imageManager ->canConvert ('SVG ' ) || $ this -> imageManager -> canConvert ( ' PNG ' )) {
149149 $ color = $ this ->themingDefaults ->getColorPrimary ();
150150 try {
151151 $ iconFile = $ this ->imageManager ->getCachedImage ('touchIcon- ' . $ app . $ color );
@@ -156,7 +156,7 @@ public function getTouchIcon(string $app = 'core'): Response {
156156 }
157157 $ iconFile = $ this ->imageManager ->setCachedImage ('touchIcon- ' . $ app . $ color , $ icon );
158158 }
159- $ response = new FileDisplayResponse ($ iconFile , Http::STATUS_OK , ['Content-Type ' => ' image/png ' ]);
159+ $ response = new FileDisplayResponse ($ iconFile , Http::STATUS_OK , ['Content-Type ' => $ iconFile -> getMimeType () ]);
160160 }
161161 if ($ response === null ) {
162162 $ fallbackLogo = \OC ::$ SERVERROOT . '/core/img/favicon-touch.png ' ;
0 commit comments