Are there any best practices or recommended methods for passing on information from incoming HTTP headers to outgoing requests in PHP?

When passing on information from incoming HTTP headers to outgoing requests in PHP, it is important to ensure that sensitive headers are properly sanitized to prevent security vulnerabilities. One recommended method is to use the `getallheaders()` function to retrieve all incoming headers, then loop through them and add the necessary headers to the outgoing request using `header()` function.

// Retrieve all incoming headers
$headers = getallheaders();

// Loop through the headers and add them to the outgoing request
foreach ($headers as $key => $value) {
    // Add only necessary headers to the outgoing request
    if ($key === 'Authorization') {
        header("$key: $value");
    }
}