diff options
| author | Christian Cleberg <[email protected]> | 2026-03-01 19:32:52 -0600 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-03-01 19:32:52 -0600 |
| commit | a98c2a4542e19ce4fb632bc32fc47c18273161cc (patch) | |
| tree | 99d016c1c9f12d98d57cfec34262e7c228a1d920 /vendor/ralouphie/getallheaders/src | |
| parent | cd8c38db601355003510e92a0936cde6b71cf849 (diff) | |
| download | michelangelo-a98c2a4542e19ce4fb632bc32fc47c18273161cc.tar.gz michelangelo-a98c2a4542e19ce4fb632bc32fc47c18273161cc.tar.bz2 michelangelo-a98c2a4542e19ce4fb632bc32fc47c18273161cc.zip | |
convert from PHP to Go
Diffstat (limited to 'vendor/ralouphie/getallheaders/src')
| -rw-r--r-- | vendor/ralouphie/getallheaders/src/getallheaders.php | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/vendor/ralouphie/getallheaders/src/getallheaders.php b/vendor/ralouphie/getallheaders/src/getallheaders.php deleted file mode 100644 index c7285a5..0000000 --- a/vendor/ralouphie/getallheaders/src/getallheaders.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php - -if (!function_exists('getallheaders')) { - - /** - * Get all HTTP header key/values as an associative array for the current request. - * - * @return string[string] The HTTP header key/value pairs. - */ - function getallheaders() - { - $headers = array(); - - $copy_server = array( - 'CONTENT_TYPE' => 'Content-Type', - 'CONTENT_LENGTH' => 'Content-Length', - 'CONTENT_MD5' => 'Content-Md5', - ); - - foreach ($_SERVER as $key => $value) { - if (substr($key, 0, 5) === 'HTTP_') { - $key = substr($key, 5); - if (!isset($copy_server[$key]) || !isset($_SERVER[$key])) { - $key = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', $key)))); - $headers[$key] = $value; - } - } elseif (isset($copy_server[$key])) { - $headers[$copy_server[$key]] = $value; - } - } - - if (!isset($headers['Authorization'])) { - if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])) { - $headers['Authorization'] = $_SERVER['REDIRECT_HTTP_AUTHORIZATION']; - } elseif (isset($_SERVER['PHP_AUTH_USER'])) { - $basic_pass = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : ''; - $headers['Authorization'] = 'Basic ' . base64_encode($_SERVER['PHP_AUTH_USER'] . ':' . $basic_pass); - } elseif (isset($_SERVER['PHP_AUTH_DIGEST'])) { - $headers['Authorization'] = $_SERVER['PHP_AUTH_DIGEST']; - } - } - - return $headers; - } - -} |
