1
0
Fork 0
mirror of https://github.com/servo/servo.git synced 2025-09-22 21:00:14 +01:00
servo/tests/wpt/web-platform-tests/common/form-submission.py

10 lines
414 B
Python

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")