blob: 2d15dc09c4e86b5938d5d95cefa65417b16f82ae (
plain)
1
2
3
4
5
6
7
8
9
10
|
def main(request, response):
response_headers = [(b"Access-Control-Allow-Origin", b"*")]
body = b"""
<p id=referrer>%s</p>
<script>
const referrer_text = referrer.textContent;
window.parent.postMessage(referrer_text, "*");
</script>
""" % request.headers.get(b"referer", b"")
return (200, response_headers, body)
|