Merge pull request #20189 from owncloud/use-get-http-protocol
Use getHttpProtocol instead of $_SERVER
This commit is contained in:
commit
b6ca23afe1
3 changed files with 6 additions and 6 deletions
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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';
|
||||
|
|
Loading…
Reference in a new issue