lib/private/AppFramework/Http/Request.php 1 location
|
@@ 573-587 (lines=15) @@
|
570 |
|
* |
571 |
|
* @return string HTTP protocol. HTTP/2, HTTP/1.1 or HTTP/1.0. |
572 |
|
*/ |
573 |
|
public function getHttpProtocol() { |
574 |
|
$claimedProtocol = strtoupper($this->server['SERVER_PROTOCOL']); |
575 |
|
|
576 |
|
$validProtocols = [ |
577 |
|
'HTTP/1.0', |
578 |
|
'HTTP/1.1', |
579 |
|
'HTTP/2', |
580 |
|
]; |
581 |
|
|
582 |
|
if(in_array($claimedProtocol, $validProtocols, true)) { |
583 |
|
return $claimedProtocol; |
584 |
|
} |
585 |
|
|
586 |
|
return 'HTTP/1.1'; |
587 |
|
} |
588 |
|
|
589 |
|
/** |
590 |
|
* Returns the request uri, even if the website uses one or more |
lib/private/legacy/template.php 1 location
|
@@ 386-397 (lines=12) @@
|
383 |
|
* @return string HTTP protocol. HTTP/2, HTTP/1.1 or HTTP/1.0. |
384 |
|
* @internal Don't use this - use AppFramework\Http\Request->getHttpProtocol instead |
385 |
|
*/ |
386 |
|
protected static function getHttpProtocol() { |
387 |
|
$claimedProtocol = strtoupper($_SERVER['SERVER_PROTOCOL']); |
388 |
|
$validProtocols = [ |
389 |
|
'HTTP/1.0', |
390 |
|
'HTTP/1.1', |
391 |
|
'HTTP/2', |
392 |
|
]; |
393 |
|
if(in_array($claimedProtocol, $validProtocols, true)) { |
394 |
|
return $claimedProtocol; |
395 |
|
} |
396 |
|
return 'HTTP/1.1'; |
397 |
|
} |
398 |
|
|
399 |
|
/** |
400 |
|
* @return bool |