Socket
Socket
Sign inDemoInstall

@miniflare/http-server

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@miniflare/http-server - npm Package Compare versions

Comparing version 2.0.0-next.2 to 2.0.0-next.3

28

dist/src/index.js

@@ -356,4 +356,5 @@ var __defProp = Object.defineProperty;

if (reconnected) ws.onopen = reload;
ws.onmessage = reload;
ws.onclose = function(e) { e.code === 1000 || e.code === 1001 || setTimeout(connect, 1000, true); }
ws.onclose = function(e) {
e.code === 1012 ? reload() : e.code === 1000 || e.code === 1001 || setTimeout(connect, 1000, true);
}
}

@@ -363,3 +364,3 @@ connect();

<\/script>`;
var liveReloadRewriter = void 0;
var liveReloadScriptLength = Buffer.byteLength(liveReloadScript);
async function convertNodeRequest(req, upstream, meta) {

@@ -461,14 +462,11 @@ const url = new URL(req.url ?? "", upstream ?? `http://${req.headers.host}`);

}
res?.writeHead(status, headers);
if (HTTPPlugin2.liveReload && response.encodeBody === "auto" && response.headers.get("content-type")?.toLowerCase().includes("text/html")) {
if (liveReloadRewriter === void 0) {
const { HTMLRewriter } = await import("@miniflare/html-rewriter");
liveReloadRewriter = new HTMLRewriter().on("body", {
element(end) {
end.append(liveReloadScript, { html: true });
}
});
const liveReloadEnabled = HTTPPlugin2.liveReload && response.encodeBody === "auto" && response.headers.get("content-type")?.toLowerCase().includes("text/html");
const contentLength = response.headers.get("content-length");
if (liveReloadEnabled && contentLength !== null) {
const length = parseInt(contentLength);
if (!isNaN(length)) {
headers["content-length"] = length + liveReloadScriptLength;
}
response = liveReloadRewriter.transform(response);
}
res?.writeHead(status, headers);
if (res) {

@@ -482,2 +480,5 @@ const passThrough = new PassThrough();

}
if (liveReloadEnabled) {
passThrough.write(liveReloadScript);
}
}

@@ -563,3 +564,2 @@ passThrough.end();

for (const ws of liveReloadServer.clients) {
ws.send("");
ws.close(1012, "Service Restart");

@@ -566,0 +566,0 @@ }

{
"name": "@miniflare/http-server",
"version": "2.0.0-next.2",
"version": "2.0.0-next.3",
"description": "HTTP server module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers",

@@ -20,2 +20,5 @@ "keywords": [

],
"engines": {
"node": ">=16.7"
},
"publishConfig": {

@@ -26,9 +29,9 @@ "access": "public"

"type": "git",
"url": "git+https://github.com/mrbbot/miniflare.git",
"url": "git+https://github.com/cloudflare/miniflare.git",
"directory": "packages/http-server"
},
"bugs": {
"url": "https://github.com/mrbbot/miniflare/issues"
"url": "https://github.com/cloudflare/miniflare/issues"
},
"homepage": "https://github.com/mrbbot/miniflare/tree/master/packages/http-server#readme",
"homepage": "https://github.com/cloudflare/miniflare/tree/master/packages/http-server#readme",
"volta": {

@@ -38,9 +41,8 @@ "extends": "../../package.json"

"dependencies": {
"@miniflare/core": "2.0.0-next.2",
"@miniflare/html-rewriter": "2.0.0-next.2",
"@miniflare/shared": "2.0.0-next.2",
"@miniflare/web-sockets": "2.0.0-next.2",
"@miniflare/core": "2.0.0-next.3",
"@miniflare/shared": "2.0.0-next.3",
"@miniflare/web-sockets": "2.0.0-next.3",
"kleur": "^4.1.4",
"selfsigned": "^1.10.11",
"undici": "^4.8.1",
"undici": "^4.9.3",
"ws": "^8.2.2",

@@ -50,5 +52,5 @@ "youch": "^2.2.2"

"devDependencies": {
"@miniflare/shared-test": "2.0.0-next.2",
"@miniflare/shared-test": "2.0.0-next.3",
"@types/node-forge": "^0.10.4"
}
}

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