Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/rtail-expressjs/node_modules/xmlhttprequest-ssl/tests/ drwxr-xr-x | |
| Viewing file: Select action/file-type: var sys = require("util")
, assert = require("assert")
, http = require("http")
, XMLHttpRequest = require("../lib/XMLHttpRequest").XMLHttpRequest
, xhr;
// Test server
var server = http.createServer(function (req, res) {
var body = (req.method != "HEAD" ? "Hello World" : "");
res.writeHead(200, {
"Content-Type": "text/plain",
"Content-Length": Buffer.byteLength(body)
});
// HEAD has no body
if (req.method != "HEAD") {
res.write(body);
}
res.end();
assert.equal(onreadystatechange, true);
assert.equal(readystatechange, true);
assert.equal(removed, true);
console.log("done");
this.close();
}).listen(8000);
xhr = new XMLHttpRequest();
// Track event calls
var onreadystatechange = false;
var readystatechange = false;
var removed = true;
var removedEvent = function() {
removed = false;
};
xhr.onreadystatechange = function() {
onreadystatechange = true;
};
xhr.addEventListener("readystatechange", function() {
readystatechange = true;
});
// This isn't perfect, won't guarantee it was added in the first place
xhr.addEventListener("readystatechange", removedEvent);
xhr.removeEventListener("readystatechange", removedEvent);
xhr.open("GET", "http://localhost:8000");
xhr.send();
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0045 ]-- |