diff options
author | Marvin Hagemeister <marvin@deno.com> | 2024-05-17 14:35:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-17 18:05:19 +0530 |
commit | 812f2e4c22182fdbaf783dba3cc9d178783eced7 (patch) | |
tree | 5c0f7123981248b088b7bf007bca0cb9748e5699 /ext/http/00_serve.ts | |
parent | 20cb0e8863beb0d709adc2f41905ce3f1f465447 (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.ts | 4 |
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 }) => { |