vendor/zendframework/zend-diactoros/src/functionsnormalize_server.php

Functions

normalizeServer()

normalizeServer(array  $server, null|callable  $apacheRequestHeaderCallback = null) : array

Marshal the $_SERVER array

Pre-processes and returns the $_SERVER superglobal. In particularly, it attempts to detect the Authorization header, which is often not aggregated correctly under various SAPI/httpd combinations.

Parameters

array $server
null|callable $apacheRequestHeaderCallback

Callback that can be used to retrieve Apache request headers. This defaults to apache_request_headers under the Apache mod_php.

Returns

array —

Either $server verbatim, or with an added HTTP_AUTHORIZATION header.