summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/scroll-to-text-fragment/stash.py
blob: f66f32ad8dbcdd34dd4ff61d5983e889a741e007 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
import time

def main(request, response):
    key = request.GET.first(b"key")

    if request.method == u"POST":
        # Received result data from target page
        request.server.stash.put(key, request.body, u'/scroll-to-text-fragment/')
        return u"ok"
    else:
        # Request for result data from test page
        value = request.server.stash.take(key, u'/scroll-to-text-fragment/')
        return value