OLD | NEW |
1 import json | 1 import json |
2 | 2 |
3 RESPONSE = """ | 3 RESPONSE = """ |
4 <!DOCTYPE html> | 4 <!DOCTYPE html> |
5 <html> | 5 <html> |
6 <head> | 6 <head> |
7 <title>Clear-Site-Data</title> | 7 <title>Clear-Site-Data</title> |
8 <script src="test_utils.js"></script> | 8 <script src="test_utils.js"></script> |
9 </head> | 9 </head> |
10 <body> | 10 <body> |
(...skipping 16 matching lines...) Expand all Loading... |
27 </html> | 27 </html> |
28 """ | 28 """ |
29 | 29 |
30 # A support server that receives a list of datatypes in the GET query | 30 # A support server that receives a list of datatypes in the GET query |
31 # and returns a Clear-Site-Data header with those datatypes. The content | 31 # and returns a Clear-Site-Data header with those datatypes. The content |
32 # of the response is a html site using postMessage to report the status | 32 # of the response is a html site using postMessage to report the status |
33 # of the datatypes, so that if used in an iframe, it can inform the | 33 # of the datatypes, so that if used in an iframe, it can inform the |
34 # embedder whether the data deletion succeeded. | 34 # embedder whether the data deletion succeeded. |
35 def main(request, response): | 35 def main(request, response): |
36 types = [key for key in request.GET.keys()] | 36 types = [key for key in request.GET.keys()] |
37 header = json.dumps({ "types": types }) | 37 header = ",".join("\"" + type + "\"" for type in types) |
38 return ([("Clear-Site-Data", header), | 38 return ([("Clear-Site-Data", header), |
39 ("Content-Type", "text/html")], | 39 ("Content-Type", "text/html")], |
40 RESPONSE) | 40 RESPONSE) |
OLD | NEW |