summaryrefslogtreecommitdiff
path: root/ext/http/00_serve.ts
diff options
context:
space:
mode:
authorMarvin Hagemeister <marvin@deno.com>2024-05-17 14:35:19 +0200
committerGitHub <noreply@github.com>2024-05-17 18:05:19 +0530
commit812f2e4c22182fdbaf783dba3cc9d178783eced7 (patch)
tree5c0f7123981248b088b7bf007bca0cb9748e5699 /ext/http/00_serve.ts
parent20cb0e8863beb0d709adc2f41905ce3f1f465447 (diff)
fix: serve handler error with 0 arguments (#23652)
Fixes https://github.com/denoland/deno/issues/23651 Co-authored-by: Satya Rohith <me@satyarohith.com>
Diffstat (limited to 'ext/http/00_serve.ts')
-rw-r--r--ext/http/00_serve.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/http/00_serve.ts b/ext/http/00_serve.ts
index b12a87390..de94779dc 100644
--- a/ext/http/00_serve.ts
+++ b/ext/http/00_serve.ts
@@ -793,9 +793,9 @@ internals.serveHttpOnConnection = serveHttpOnConnection;
function registerDeclarativeServer(exports) {
if (ObjectHasOwn(exports, "fetch")) {
- if (typeof exports.fetch !== "function" || exports.fetch.length !== 1) {
+ if (typeof exports.fetch !== "function") {
throw new TypeError(
- "Invalid type for fetch: must be a function with a single parameter",
+ "Invalid type for fetch: must be a function with a single or no parameter",
);
}
return ({ servePort, serveHost }) => {