@honojs/node-server
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -5,2 +5,3 @@ "use strict"; | ||
const node_http_1 = require("node:http"); | ||
const fetch_1 = require("./fetch"); | ||
const stream_1 = require("./stream"); | ||
@@ -38,3 +39,3 @@ const globals_1 = require("./globals"); | ||
}; | ||
if (!(method === ('GET' || 'HEAD'))) { | ||
if (!(method === 'GET' || method === 'HEAD')) { | ||
const buffers = []; | ||
@@ -47,3 +48,9 @@ for await (const chunk of incoming) { | ||
} | ||
const res = (await fetchCallback(new Request(url.toString(), init))); | ||
let res; | ||
try { | ||
res = (await fetchCallback(new Request(url.toString(), init))); | ||
} | ||
catch { | ||
res = new fetch_1.Response(null, { status: 500 }); | ||
} | ||
const contentType = res.headers.get('content-type') || ''; | ||
@@ -50,0 +57,0 @@ for (const [k, v] of res.headers) { |
{ | ||
"name": "@honojs/node-server", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "HTTP Server for Hono on Node.js", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
14855
317