xfo.py (636B)
1 def main(request, response): 2 headers = [(b"Content-Type", b"text/html"), (b"X-Frame-Options", request.GET.first(b"value"))] 3 4 if b"value2" in request.GET: 5 headers.append((b"X-Frame-Options", request.GET.first(b"value2"))) 6 7 if b"csp_value" in request.GET: 8 headers.append((b"Content-Security-Policy", request.GET.first(b"csp_value"))) 9 10 body = u"""<!DOCTYPE html> 11 <html> 12 <head> 13 <title>XFO.</title> 14 <script>window.parent.postMessage('Loaded', '*');</script> 15 </head> 16 <body> 17 Loaded 18 </body> 19 </html> 20 """ 21 return (headers, body)