Created
November 26, 2011 13:33
-
-
Save joneskoo/1395673 to your computer and use it in GitHub Desktop.
Print all headers available to the web server except some non-public headers
This file contains hidden or 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
#!/usr/bin/python | |
print "Content-type: text/plain; charset=UTF-8" | |
import os | |
ignore_these = [ | |
'PATH', | |
'DOCUMENT_ROOT', | |
'SCRIPT_FILENAME', | |
'SERVER_ADMIN', | |
'SERVER_NAME', | |
'GATEWAY_INTERFACE', | |
'SERVER_SOFTWARE', | |
'SERVER_SIGNATURE' | |
] | |
env = os.environ.items() | |
env.sort() | |
for (name, value) in env: | |
if name not in ignore_these: | |
print '%s = "%s"' % (name, value) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment