summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-10-09 11:30:53 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-10-09 11:30:53 +0200
commit18ad60380cdd5c5e346f6b2a8dfbef0a204e00b2 (patch)
treeb6e13e356b82a3c1129c9da18f61128bbfe5c6b3 /lib
parent5cb83937faf7a6cf72c932346fcf62073d4b405b (diff)
parent14591d9df70ed453b911b5c6647cb2fd20cf5be5 (diff)
downloadnextcloud-server-18ad60380cdd5c5e346f6b2a8dfbef0a204e00b2.tar.gz
nextcloud-server-18ad60380cdd5c5e346f6b2a8dfbef0a204e00b2.zip
Merge pull request #18586 from owncloud/ie8-uploadavatar
Fix uploading avatar and root certs in IE8
Diffstat (limited to 'lib')
-rw-r--r--lib/private/appframework/http/request.php1
-rw-r--r--lib/public/appframework/controller.php8
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/private/appframework/http/request.php b/lib/private/appframework/http/request.php
index 3e24eec37c8..77785135162 100644
--- a/lib/private/appframework/http/request.php
+++ b/lib/private/appframework/http/request.php
@@ -43,6 +43,7 @@ use OCP\Security\ISecureRandom;
class Request implements \ArrayAccess, \Countable, IRequest {
const USER_AGENT_IE = '/MSIE/';
+ const USER_AGENT_IE_8 = '/MSIE 8.0/';
// Android Chrome user agent: https://developers.google.com/chrome/mobile/docs/user-agent
const USER_AGENT_ANDROID_MOBILE_CHROME = '#Android.*Chrome/[.0-9]*#';
const USER_AGENT_FREEBOX = '#^Mozilla/5\.0$#';
diff --git a/lib/public/appframework/controller.php b/lib/public/appframework/controller.php
index b8986c0b772..5c7292cd130 100644
--- a/lib/public/appframework/controller.php
+++ b/lib/public/appframework/controller.php
@@ -83,7 +83,13 @@ abstract class Controller {
$data->getData(),
$data->getStatus()
);
- $response->setHeaders(array_merge($data->getHeaders(), $response->getHeaders()));
+ $dataHeaders = $data->getHeaders();
+ $headers = $response->getHeaders();
+ // do not overwrite Content-Type if it already exists
+ if (isset($dataHeaders['Content-Type'])) {
+ unset($headers['Content-Type']);
+ }
+ $response->setHeaders(array_merge($dataHeaders, $headers));
return $response;
} else {
return new JSONResponse($data);