コード例 #1
0
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("samesite_none_insecure", False))
    headers.append(makeDropCookie("samesite_none_secure", True))
    return headers, '{"success": true}'
コード例 #2
0
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("samesite_none_insecure", False))
    headers.append(makeDropCookie("samesite_none_secure", True))
    return headers, '{"success": true}'
コード例 #3
0
ファイル: dropSecure.py プロジェクト: bocoup/wpt-docs
def main(request, response):
    """Respond to `/cookie/drop/secure` by dropping the two cookie set by
    `setSecureTestCookies()`"""
    headers = setNoCacheAndCORSHeaders(request, response)

    # Expire the cookies, and return a JSON-encoded success code.
    headers.append(makeDropCookie("alone_secure", False))
    headers.append(makeDropCookie("alone_insecure", False))
    return headers, '{"success": true}'
コード例 #4
0
ファイル: dropSameSite.py プロジェクト: zachlewis2020/wpt
def main(request, response):
    """Respond to `/cookie/same-site/resources/dropSameSite.py by dropping the
    four cookies set by setSameSiteCookies.py"""
    headers = setNoCacheAndCORSHeaders(request, response)

    # Expire the cookies, and return a JSON-encoded success code.
    headers.append(makeDropCookie(b"samesite_strict", False))
    headers.append(makeDropCookie(b"samesite_lax", False))
    headers.append(makeDropCookie(b"samesite_none", False))
    headers.append(makeDropCookie(b"samesite_unspecified", False))
    return headers, b'{"success": true}'
コード例 #5
0
def main(request, response):
    """Respond to `/cookie/same-site/resources/dropSameSite.py by dropping the
    four cookies set by setSameSiteCookies.py"""
    headers = setNoCacheAndCORSHeaders(request, response)

    # Expire the cookies, and return a JSON-encoded success code.
    headers.append(makeDropCookie("samesite_strict", False))
    headers.append(makeDropCookie("samesite_lax", False))
    headers.append(makeDropCookie("samesite_none", False))
    headers.append(makeDropCookie("samesite_unspecified", False))
    return headers, '{"success": true}'
コード例 #6
0
ファイル: drop.py プロジェクト: Coder206/servo
def main(request, response):
    """Respond to `/cookie/drop?name={name}` by expiring the cookie named `{name}`."""
    headers = setNoCacheAndCORSHeaders(request, response)
    try:
        # Expire the named cookie, and return a JSON-encoded success code.
        name = readParameter(request, paramName="name", requireValue=True)
        scheme = request.url_parts.scheme
        headers.append(makeDropCookie(name,  "https" == scheme))
        return headers, '{"success": true}'
    except:
        return 500, headers, '{"error" : "Empty or missing name parameter."}'
コード例 #7
0
ファイル: drop.py プロジェクト: zachlewis2020/wpt
def main(request, response):
    """Respond to `/cookie/drop?name={name}` by expiring the cookie named `{name}`."""
    headers = setNoCacheAndCORSHeaders(request, response)
    try:
        # Expire the named cookie, and return a JSON-encoded success code.
        name = readParameter(request, paramName=u"name", requireValue=True)
        scheme = request.url_parts.scheme
        headers.append(makeDropCookie(name, u"https" == scheme))
        return headers, b'{"success": true}'
    except:
        return 500, headers, b'{"error" : "Empty or missing name parameter."}'