Created
April 24, 2015 17:52
-
-
Save yosemitebandit/4886c5da7fb04abca1d3 to your computer and use it in GitHub Desktop.
header testing script
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
import requests | |
good_hosts = ('www.endaga.com', 'endaga.com', 'staff.endaga.com', | |
'staging.endaga.com') | |
bad_hosts = ('www.bad-host.com', 'bad-host.com') | |
url = 'https://staging.endaga.com' | |
print 'GET %s' % url | |
for host in good_hosts + bad_hosts: | |
headers = { | |
'HTTP_HOST': host | |
} | |
response = requests.get(url, headers=headers) | |
print 'HTTP_HOST %s -> %s' % (host, response.status_code) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment