blob: 9b90b146955b86b15e828da7111faefaa25699c2 [file] [log] [blame]
def main(request, response):
if b"url" in request.GET:
headers = [(b"Location", request.GET[b"url"])]
return 302, headers, b''
status = 200
if b"noLocationRedirect" in request.GET:
status = 302
return status, [(b"content-type", b"text/html")], b'''
<!DOCTYPE html>
<script>
onmessage = event => {
window.parent.postMessage(
{
id: event.data.id,
result: location.href
}, '*');
};
</script>
'''