Skip to content

Instantly share code, notes, and snippets.

@benhagen
Created December 3, 2013 22:28
Show Gist options
  • Save benhagen/7778742 to your computer and use it in GitHub Desktop.
Save benhagen/7778742 to your computer and use it in GitHub Desktop.
Super simple script to check referer header restrictions on a URL.
#!/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