summaryrefslogtreecommitdiffstats
path: root/apps/theming
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-01-19 15:36:31 -0600
committerGitHub <noreply@github.com>2017-01-19 15:36:31 -0600
commit8565011b8d9eebd36781fed71d1d2965ce238c9f (patch)
tree74cb3e8f3ad1df0a0268f69b5b04ad75359fe880 /apps/theming
parent13a5c5d64c3ef0942225f02e8d812e0a4f621aa9 (diff)
parentbe3ec7ffb78aa42731e4e1170b5c190549d87e75 (diff)
downloadnextcloud-server-8565011b8d9eebd36781fed71d1d2965ce238c9f.tar.gz
nextcloud-server-8565011b8d9eebd36781fed71d1d2965ce238c9f.zip
Merge pull request #3144 from nextcloud/use-data-download-response
Use DataDownloadResponse
Diffstat (limited to 'apps/theming')
-rw-r--r--apps/theming/lib/Controller/ThemingController.php3
-rw-r--r--apps/theming/tests/Controller/ThemingControllerTest.php7
2 files changed, 3 insertions, 7 deletions
diff --git a/apps/theming/lib/Controller/ThemingController.php b/apps/theming/lib/Controller/ThemingController.php
index 9145717c4a0..24ac1c7d8d5 100644
--- a/apps/theming/lib/Controller/ThemingController.php
+++ b/apps/theming/lib/Controller/ThemingController.php
@@ -446,8 +446,7 @@ class ThemingController extends Controller {
cacheBuster: ' . json_encode($cacheBusterValue). '
};
})();';
- $response = new Http\DataDisplayResponse($responseJS);
- $response->addHeader('Content-type', 'text/javascript');
+ $response = new DataDownloadResponse($responseJS, 'javascript', 'text/javascript');
$response->addHeader('Expires', date(\DateTime::RFC2822, $this->timeFactory->getTime()));
$response->addHeader('Pragma', 'cache');
$response->cacheFor(3600);
diff --git a/apps/theming/tests/Controller/ThemingControllerTest.php b/apps/theming/tests/Controller/ThemingControllerTest.php
index c19d609d909..97a5e985860 100644
--- a/apps/theming/tests/Controller/ThemingControllerTest.php
+++ b/apps/theming/tests/Controller/ThemingControllerTest.php
@@ -914,7 +914,6 @@ class ThemingControllerTest extends TestCase {
'background-image: url(\'./img/core/filetypes/folder.svg?v=0\');' . "}\n" .
'.icon-filetype-folder-drag-accept {' .
'background-image: url(\'./img/core/filetypes/folder-drag-accept.svg?v=0\')!important;' . "}\n";
- $expected = new Http\DataDownloadResponse($expectedData, 'style', 'text/css');
$expected = new Http\DataDownloadResponse($expectedData, 'style', 'text/css');
$expected->cacheFor(3600);
@@ -952,8 +951,7 @@ class ThemingControllerTest extends TestCase {
cacheBuster: null
};
})();';
- $expected = new Http\DataDisplayResponse($expectedResponse);
- $expected->addHeader("Content-type","text/javascript");
+ $expected = new Http\DataDownloadResponse($expectedResponse, 'javascript', 'text/javascript');
$expected->addHeader('Expires', date(\DateTime::RFC2822, $this->timeFactory->getTime()));
$expected->addHeader('Pragma', 'cache');
$expected->cacheFor(3600);
@@ -987,8 +985,7 @@ class ThemingControllerTest extends TestCase {
cacheBuster: null
};
})();';
- $expected = new Http\DataDisplayResponse($expectedResponse);
- $expected->addHeader("Content-type","text/javascript");
+ $expected = new Http\DataDownloadResponse($expectedResponse, 'javascript', 'text/javascript');
$expected->addHeader('Expires', date(\DateTime::RFC2822, $this->timeFactory->getTime()));
$expected->addHeader('Pragma', 'cache');
$expected->cacheFor(3600);