MCPcopy Create free account
hub / github.com/cure53/DOMPurify / httpStatus

Function httpStatus

test/browser/legacy-runner.js:45–54  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

43const PORT = Number.parseInt(process.env.PORT || '9877', 10);
44
45function httpStatus(url) {
46 return new Promise((resolve, reject) => {
47 const req = http.get(url, (res) => {
48 res.resume();
49 resolve(res.statusCode);
50 });
51 req.on('error', reject);
52 req.setTimeout(2000, () => req.destroy(new Error('timeout')));
53 });
54}
55
56async function reachable(url) {
57 try {

Callers 1

reachableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected