summaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/base.php')
-rw-r--r--lib/base.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/base.php b/lib/base.php
index b33687dbab7..be14f49cab3 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -501,7 +501,9 @@ class OC {
} catch (\RuntimeException $e) {
if (!self::$CLI) {
- OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE);
+ $claimedProtocol = strtoupper($_SERVER['SERVER_PROTOCOL']);
+ $protocol = in_array($claimedProtocol, ['HTTP/1.0', 'HTTP/1.1', 'HTTP/2']) ? $claimedProtocol : 'HTTP/1.1';
+ header($protocol . ' ' . OC_Response::STATUS_SERVICE_UNAVAILABLE);
}
// we can't use the template error page here, because this needs the
// DI container which isn't available yet