diff options
-rw-r--r-- | apps/theming/lib/Controller/ThemingController.php | 1 | ||||
-rw-r--r-- | apps/theming/tests/Controller/ThemingControllerTest.php | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/apps/theming/lib/Controller/ThemingController.php b/apps/theming/lib/Controller/ThemingController.php index 5e1e3d08dc9..e4a8f0b5036 100644 --- a/apps/theming/lib/Controller/ThemingController.php +++ b/apps/theming/lib/Controller/ThemingController.php @@ -354,6 +354,7 @@ class ThemingController extends Controller { $response->addHeader('Expires', $expires->format(\DateTime::RFC2822)); $response->addHeader('Pragma', 'cache'); $response->addHeader('Content-Type', $this->config->getAppValue($this->appName, $key . 'Mime', '')); + $response->addHeader('Content-Disposition', 'attachment; filename="' . $key . '"'); return $response; } diff --git a/apps/theming/tests/Controller/ThemingControllerTest.php b/apps/theming/tests/Controller/ThemingControllerTest.php index 6d756c13a5a..eddf5bc56dc 100644 --- a/apps/theming/tests/Controller/ThemingControllerTest.php +++ b/apps/theming/tests/Controller/ThemingControllerTest.php @@ -305,7 +305,7 @@ class ThemingControllerTest extends TestCase { $destination = \OC::$server->getTempManager()->getTemporaryFolder(); touch($tmpLogo); - copy(__DIR__ . '/../../../../tests/data/testimagelarge.svg', $tmpLogo); + copy(__DIR__ . '/../../../../tests/data/testimage.png', $tmpLogo); $this->request ->expects($this->at(0)) ->method('getParam') @@ -701,6 +701,7 @@ class ThemingControllerTest extends TestCase { $expected->addHeader('Expires', $expires->format(\DateTime::RFC2822)); $expected->addHeader('Pragma', 'cache'); $expected->addHeader('Content-Type', 'text/svg'); + $expected->addHeader('Content-Disposition', 'attachment; filename="logo"'); @$this->assertEquals($expected, $this->themingController->getImage('logo')); } @@ -733,6 +734,7 @@ class ThemingControllerTest extends TestCase { $expected->addHeader('Expires', $expires->format(\DateTime::RFC2822)); $expected->addHeader('Pragma', 'cache'); $expected->addHeader('Content-Type', 'image/png'); + $expected->addHeader('Content-Disposition', 'attachment; filename="background"'); @$this->assertEquals($expected, $this->themingController->getImage('background')); } |