summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/common/form-submission.py
blob: 467875453c9dc64aac51add3f4a617d941820972 (plain)
1
2
3
4
5
6
7
8
9
10
def main(request, response):
    if request.headers.get('Content-Type') == 'application/x-www-form-urlencoded':
        result = request.body == 'foo=bara'
    elif request.headers.get('Content-Type') == 'text/plain':
        result = request.body == 'qux=baz\r\n'
    else:
        result = request.POST.first('foo') == 'bar'

    return ([("Content-Type", "text/plain")],
            "OK" if result else "FAIL")