blob: 77328ce715608cbdff7ef188f8f663a6c5c832af [file] [log] [blame]
#!/usr/bin/env python3
import os
import sys
referer = os.environ.get('HTTP_REFERER', '')
sys.stdout.write(
'Content-Type: text/html\r\n\r\n'
'<p>Referrer: {referer}</p>\n'
'<script>\n'
'console.log("Referrer: {referer}");\n'
'\n'
'var result = "window.opener: " + (window.opener ? "FAIL" : "PASS");\n'
'document.write(result);\n'
'console.log(result);\n'
'if (window.testRunner)\n'
' testRunner.notifyDone();\n'
'</script>\n'.format(referer=referer)
)