Add XHR support for FormData

This commit is contained in:
Zhen Zhang 2016-08-08 20:55:26 +02:00
parent c420a870c1
commit 184b522230
13 changed files with 173 additions and 174 deletions

View file

@ -21,7 +21,7 @@ def main(request, response):
boundary = content_type[1].strip("boundary=")
body = "--" + boundary + "\r\nContent-Disposition: form-data; name=\"file-input\"; filename=\"upload.txt\""
body += "\r\n" + "text/plain\r\n\r\nHello\r\n--" + boundary + "--"
body += "\r\n" + "content-type: text/plain\r\n\r\nHello\r\n--" + boundary + "--"
if body != request.body:
return fail("request body doesn't match: " + body + "+++++++" + request.body)