2 <p>Test for
<a href=
"https://bugs.webkit.org/show_bug.cgi?id=40947">bug
40947</a>:
3 REGRESSION (r57544): XMLHttpRequest POSTed multipart/form-data wrongfully gets a charset appended.
</p>
4 <p>There should be no charset added, and most importantly, it shouldn't be appended to the end.
</p>
7 testRunner
.dumpAsText();
9 var boundary
= "----MISFormBoundaryMTCcH1pthhYPYEpV";
10 var contentType
= "multipart/form-data; boundary=" + boundary
;
12 body
+= '--' + boundary
+ '\r\n' + 'Content-Disposition: form-data; name="';
17 body
+= '--' + boundary
+ '--';
19 var r
= new XMLHttpRequest
;
20 r
.open("POST", "print-content-type.cgi", false);
21 r
.setRequestHeader("Content-Type", contentType
);
23 var result
= r
.responseText
.replace(/[\r\n]/g, "");
25 if (result
== contentType
)
26 document
.write("PASS");
28 document
.write("FAIL, Content-Type has been modified. Expected '" + contentType
+ "', got '" + result
+ "'.");