fix(http): handle getHttpProtocol being unset in $_SERVER['SERVER_PROTOCOL'] if called from occ

Due to the profiler app loading HttpDataCollector when running occ.

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
pull/55241/head
Thomas Citharel 2 weeks ago
parent edd8112dda
commit 7bf8e9699c
No known key found for this signature in database
  1. 2
      lib/private/AppFramework/Http/Request.php

@ -676,7 +676,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
* @return string HTTP protocol. HTTP/2, HTTP/1.1 or HTTP/1.0.
*/
public function getHttpProtocol(): string {
$claimedProtocol = $this->server['SERVER_PROTOCOL'];
$claimedProtocol = $this->server['SERVER_PROTOCOL'] ?? '';
if (\is_string($claimedProtocol)) {
$claimedProtocol = strtoupper($claimedProtocol);

Loading…
Cancel
Save