mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-24 09:27:31 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
19
dom/base/test/bug540854.sjs
Normal file
19
dom/base/test/bug540854.sjs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
const CC = Components.Constructor;
|
||||
const BinaryInputStream = CC("@mozilla.org/binaryinputstream;1",
|
||||
"nsIBinaryInputStream",
|
||||
"setInputStream");
|
||||
|
||||
function handleRequest(request, response)
|
||||
{
|
||||
response.setHeader("Content-Type", "text/plain", false);
|
||||
|
||||
var body = new BinaryInputStream(request.bodyInputStream);
|
||||
|
||||
var avail;
|
||||
var bytes = [];
|
||||
while ((avail = body.available()) > 0)
|
||||
Array.prototype.push.apply(bytes, body.readByteArray(avail));
|
||||
|
||||
var data = String.fromCharCode.apply(null, bytes);
|
||||
response.bodyOutputStream.write(data, data.length);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue