[ActivityPub][Inbox] get_all_headers was nginx only

This commit is contained in:
Diogo Cordeiro 2020-06-26 14:08:47 +01:00 committed by Diogo Peralta Cordeiro
parent bc1af78bf7
commit 25f67a1ce9

View File

@ -150,6 +150,11 @@ class apInboxAction extends ManagedAction
*/ */
private function get_all_headers() private function get_all_headers()
{ {
// If we're running on an Apache2 webserver
if (function_exists('getallheaders')) {
return getallheaders();
}
// Otherwise, do it manually.
$headers = []; $headers = [];
foreach ($_SERVER as $name => $value) { foreach ($_SERVER as $name => $value) {
if (substr($name, 0, 5) == 'HTTP_') { if (substr($name, 0, 5) == 'HTTP_') {