Fix useStream variable scope in HTTP server adapter

Moved the declaration of useStream inside the action check to prevent referencing it when action is undefined.
This commit is contained in:
手瓜一十雪 2025-09-20 15:23:37 +08:00
parent 2161ec5fa7
commit a36ae315b0

View File

@ -121,8 +121,8 @@ export class OB11HttpServerAdapter extends IOB11NetworkAdapter<HttpServerConfig>
const real_echo = payload_echo ?? Math.random().toString(36).substring(2, 15);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const action = this.actions.get(actionName as any);
const useStream = action.useStream;
if (action) {
const useStream = action.useStream;
try {
const result = await action.handle(payload, this.name, this.config, {
send: request_sse ? async (data: object) => {