https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 0c61d8d031ae0183c8682306851fb778af6df825 authored by Brian Burg on 16 July 2018, 23:05:19 UTC
webdriver: fix expected key code for "Unidentified" keys
Tip revision: 0c61d8d
set.py
import helpers
import urllib

def main(request, response):
    """Respond to `/cookie/set?{cookie}` by echoing `{cookie}` as a `Set-Cookie` header."""
    headers = helpers.setNoCacheAndCORSHeaders(request, response)

    # Cookies may require whitespace (e.g. in the `Expires` attribute), so the
    # query string should be decoded.
    cookie = urllib.unquote(request.url_parts.query)
    headers.append(("Set-Cookie", cookie))

    return headers, '{"success": true}'
back to top