https://github.com/web-platform-tests/wpt
Raw File
Tip revision: af85af6a74cbe1cda0c18d5e554a1008bdc8c2a3 authored by Matt Wolenetz on 07 September 2016, 02:42:22 UTC
Update the exception expected to be TypeError
Tip revision: af85af6
form-submission.py
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")
back to top