New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

deno-http-worker

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deno-http-worker - npm Package Compare versions

Comparing version 0.0.10 to 0.0.11

7

deno-bootstrap/index.ts

@@ -20,3 +20,3 @@ const socketFile = Deno.args[0];

mod.default.onError ??
function (error) {
function (error: unknown) {
console.error(error);

@@ -61,2 +61,7 @@ return new Response("Internal Server Error", { status: 500 });

globalThis.onerror = (e) => {
console.error(e.error);
e.preventDefault();
};
Deno.addSignalListener("SIGINT", async () => {

@@ -63,0 +68,0 @@ // On interrupt we only shut down the server. Deno will wait for all

24

dist/DenoHTTPWorker.test.js

@@ -82,3 +82,3 @@ import { it as _it, beforeAll, describe, expect } from "vitest";

// onError is not called in all cases, for example, here I can pass a
// readable stream and the error kills the process instead :(
// readable stream and the error is only caught by the global onerror handler.
let worker = await newDenoHTTPWorker(`

@@ -98,13 +98,15 @@ export default { async fetch (req: Request): Promise<Response> {

}}
`, { printOutput: true });
let exit = new Promise((resolves) => {
worker.addEventListener("exit", (code, signal) => {
resolves({ code, signal });
});
});
expect(jsonRequest(worker, "https://localhost/hello?isee=you", {
`, { printOutput: false });
jsonRequest(worker, "https://localhost/hello?isee=you", {
headers: { accept: "application/json" },
})).rejects.toThrow();
// This error seems to be "socket hang up" or "aborted", depending on timing, so we just check for the exception.
expect(await exit).toEqual({ code: 1, signal: "" });
}).catch(() => { });
while (true) {
let stderr = worker.stderr.read();
if (stderr) {
console.log(stderr.toString());
expect(stderr.toString()).toContain("expected typed ArrayBufferView");
break;
}
await new Promise((resolve) => setTimeout(resolve, 100));
}
worker.terminate();

@@ -111,0 +113,0 @@ });

{
"name": "deno-http-worker",
"version": "0.0.10",
"version": "0.0.11",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -100,3 +100,3 @@ import { it as _it, beforeAll, describe, expect } from "vitest";

// onError is not called in all cases, for example, here I can pass a
// readable stream and the error kills the process instead :(
// readable stream and the error is only caught by the global onerror handler.
let worker = await newDenoHTTPWorker(

@@ -118,17 +118,17 @@ `

`,
{ printOutput: true }
{ printOutput: false }
);
let exit = new Promise((resolves) => {
worker.addEventListener("exit", (code, signal) => {
resolves({ code, signal });
});
});
expect(
jsonRequest(worker, "https://localhost/hello?isee=you", {
headers: { accept: "application/json" },
})
).rejects.toThrow();
// This error seems to be "socket hang up" or "aborted", depending on timing, so we just check for the exception.
jsonRequest(worker, "https://localhost/hello?isee=you", {
headers: { accept: "application/json" },
}).catch(() => {});
expect(await exit).toEqual({ code: 1, signal: "" });
while (true) {
let stderr = worker.stderr.read();
if (stderr) {
console.log(stderr.toString());
expect(stderr.toString()).toContain("expected typed ArrayBufferView");
break;
}
await new Promise((resolve) => setTimeout(resolve, 100));
}
worker.terminate();

@@ -135,0 +135,0 @@ });

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc