1
from cStringIO import StringIO
3
# FIXME(chrisccoulson): We desperately need an API for clearing site data
4
# (not just cookies). This abomination is for ensuring there are no test
5
# cookies left from a previous test. Yeah, it sucks....
9
html.write("<html></html>")
11
request.send_response(200)
12
request.send_header("Content-type", "text/html")
13
request.send_header("Content-Length", html.tell())
14
request.send_header("Cache-Control", "no-cache")
16
if "Cookie" in request.headers:
17
cookies = request.headers["Cookie"].split(";")
18
for cookie in cookies:
19
request.send_header("Set-Cookie", "%s=deleted;Expires=Thu, 01-01-1970 00-00-00 GMT;Domain=;Path=/" % cookie.split("=")[0])
23
request.wfile.write(html.getvalue())