-
-
Save alexpott/c3903713ac888b069b915975162dc718 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Run this script with command: | |
// curl -H 'Proxy: AFFECTED' http://localhost/httpoxy.php | |
putenv("HTTP_PROXY="); $_SERVER['HTTP_PROXY'] = ""; | |
print "Env:" . getenv('HTTP_PROXY') . "\n"; // Amazingly this is still AFFECTED | |
print "Server:" . $_SERVER['HTTP_PROXY']; // This is the expected empty string |
The Red Hat example (linked above) has since been updated to use "apache_setenv" also. Still not clear if their example actually works under CGI though.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try putting
apache_setenv('HTTP_PROXY', '');
at the end of the first line... then it seems to work correctly (at least on mod_php).(I think that's what https://access.redhat.com/solutions/2442861 meant to suggest, but the example there uses "apache_putenv" instead...)