Created
December 3, 2013 22:28
-
-
Save benhagen/7778742 to your computer and use it in GitHub Desktop.
Super simple script to check referer header restrictions on a URL.
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
#!/usr/bin/env python | |
import requests | |
url = "http://testurl/" | |
referer = "https://refererurl/" | |
print "URL: {}\nREFERER: {}\n".format(url, referer) | |
request = requests.get(url, headers={"Referer": referer}) | |
print "With referer: {}".format(request.status_code) | |
request = requests.get(url) | |
print "Without referer: {}".format(request.status_code) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment