Refactors add_request_header() for usage in both fpm and cgi.