summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-10-30 18:05:30 +0100
committerLukas Reschke <lukas@owncloud.com>2015-10-30 18:05:30 +0100
commitbafb86fb9fce1ad4457c6e2f7aba9604e33908ce (patch)
tree7a0e71b14f5afd9edd0d6824841a4471d6c60a7a /lib
parent6911d8f0a4e688f3c84f2dd117424f887820750a (diff)
downloadnextcloud-server-bafb86fb9fce1ad4457c6e2f7aba9604e33908ce.tar.gz
nextcloud-server-bafb86fb9fce1ad4457c6e2f7aba9604e33908ce.zip
Use getHttpProtocol instead of $_SERVER
Diffstat (limited to 'lib')
-rw-r--r--lib/private/appframework/dependencyinjection/dicontainer.php9
-rw-r--r--lib/private/appframework/http.php1
-rw-r--r--lib/private/response.php2
3 files changed, 6 insertions, 6 deletions
diff --git a/lib/private/appframework/dependencyinjection/dicontainer.php b/lib/private/appframework/dependencyinjection/dicontainer.php
index b71ca71391d..b0be4045541 100644
--- a/lib/private/appframework/dependencyinjection/dicontainer.php
+++ b/lib/private/appframework/dependencyinjection/dicontainer.php
@@ -252,11 +252,10 @@ class DIContainer extends SimpleContainer implements IAppContainer {
});
$this->registerService('Protocol', function($c){
- if(isset($_SERVER['SERVER_PROTOCOL'])) {
- return new Http($_SERVER, $_SERVER['SERVER_PROTOCOL']);
- } else {
- return new Http($_SERVER);
- }
+ /** @var \OC\Server $server */
+ $server = $c->query('ServerContainer');
+ $protocol = $server->getRequest()->getHttpProtocol();
+ return new Http($_SERVER, $protocol);
});
$this->registerService('Dispatcher', function($c) {
diff --git a/lib/private/appframework/http.php b/lib/private/appframework/http.php
index 89f6f70f4e7..e64759fa924 100644
--- a/lib/private/appframework/http.php
+++ b/lib/private/appframework/http.php
@@ -112,6 +112,7 @@ class Http extends BaseHttp {
* @param Http::CONSTANT $status the constant from the Http class
* @param \DateTime $lastModified formatted last modified date
* @param string $ETag the etag
+ * @return string
*/
public function getStatusHeader($status, \DateTime $lastModified=null,
$ETag=null) {
diff --git a/lib/private/response.php b/lib/private/response.php
index 2cd1d990e51..b0eb8adc4d5 100644
--- a/lib/private/response.php
+++ b/lib/private/response.php
@@ -74,7 +74,7 @@ class OC_Response {
* @param int $status a HTTP status code, see also the STATUS constants
*/
static public function setStatus($status) {
- $protocol = $_SERVER['SERVER_PROTOCOL'];
+ $protocol = \OC::$server->getRequest()->getHttpProtocol();
switch($status) {
case self::STATUS_NOT_MODIFIED:
$status = $status . ' Not Modified';