summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/forms/form-submission-0/resources/file-submission.py
blob: 89cd182add99c5dcba96dda54e1b800e959518d3 (plain)
1
2
3
4
5
6
7
8
9
10
import json

from wptserve.utils import isomorphic_decode

def main(request, response):
    headers = [(b"Content-Type", b"text/html")]
    testinput = request.POST.first(b"testinput")
    value = isomorphic_decode(testinput.value)
    body = u"<script>parent.postMessage(" + json.dumps(value) + u", '*');</script>"
    return headers, body