1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
def main(request, response): if "url" in request.GET: headers = [("Location", request.GET["url"])] return 302, headers, '' return [], ''' <!DOCTYPE html> <script> window.parent.postMessage( { id: 'last_url', result: location.href }, '*'); </script> '''