test_bug413974.html (962B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=413974 5 --> 6 <head> 7 <title>Test for Bug 413974</title> 8 <script src="/tests/SimpleTest/SimpleTest.js"></script> 9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 10 </head> 11 <body> 12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=413974">Mozilla Bug 413974</a> 13 <p id="display"></p> 14 <div id="content" style="display: none"> 15 16 </div> 17 <pre id="test"> 18 <script class="testbody" type="text/javascript"> 19 20 /** Test for Bug 413974 */ 21 var req = new XMLHttpRequest(); 22 req.open("POST", window.location.href); 23 req.setRequestHeader("Content-Type", "text/plain; boundary=01234567890"); 24 req.send("Some text"); 25 26 is(SpecialPowers.wrap(req).channel 27 .QueryInterface(SpecialPowers.Ci.nsIHttpChannel) 28 .getRequestHeader("Content-Type"), 29 "text/plain; boundary=01234567890", 30 "Charset should come before boundary"); 31 </script> 32 </pre> 33 </body> 34 </html>