mirror of
https://github.com/servo/servo.git
synced 2025-07-01 04:23:39 +01:00
10 lines
414 B
Python
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")
|