summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/cookies/resources/dropSameSiteNone.py
blob: 2d0a837b5d90dbf6ec16a030f2107bdbdb2dc15d (plain)
1
2
3
4
5
6
7
8
9
10
11
from cookies.resources.helpers import makeDropCookie, setNoCacheAndCORSHeaders

def main(request, response):
    """Respond to `/cookies/resources/dropSameSiteNone.py by dropping the
    two cookies set by setSameSiteNone.py"""
    headers = setNoCacheAndCORSHeaders(request, response)

    # Expire the cookies, and return a JSON-encoded success code.
    headers.append(makeDropCookie(b"samesite_none_insecure", False))
    headers.append(makeDropCookie(b"samesite_none_secure", True))
    return headers, b'{"success": true}'