(handler)
| 10308 | this.#dispatcher = dispatcher; |
| 10309 | } |
| 10310 | static wrapHandler(handler) { |
| 10311 | if (!handler || typeof handler !== "object") { |
| 10312 | throw new InvalidArgumentError("handler must be an object"); |
| 10313 | } |
| 10314 | if (typeof handler.onRequestStart === "function") { |
| 10315 | return handler; |
| 10316 | } |
| 10317 | return new LegacyHandlerWrapper(handler); |
| 10318 | } |
| 10319 | dispatch(opts, handler) { |
| 10320 | if (opts.allowH2 !== false) { |
| 10321 | opts = { ...opts, allowH2: false }; |