milkio 0.0.18 → 0.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -148,7 +148,7 @@ export function defineHttpHandler(app: MilkioApp, options: ExecuteHttpServerOpti
|
|
|
148
148
|
|
|
149
149
|
// @ts-ignore
|
|
150
150
|
// eslint-disable-next-line @typescript-eslint/no-confusing-void-expression, @typescript-eslint/no-explicit-any
|
|
151
|
-
response.body
|
|
151
|
+
if (!response.body) response.body = result
|
|
152
152
|
|
|
153
153
|
// before response middleware
|
|
154
154
|
const middlewareResponse = {
|
|
@@ -166,7 +166,7 @@ export function defineHttpHandler(app: MilkioApp, options: ExecuteHttpServerOpti
|
|
|
166
166
|
status: response.status,
|
|
167
167
|
responseHeaders: response.headers,
|
|
168
168
|
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
169
|
-
body: response.body
|
|
169
|
+
body: response.body?.toString() ?? "",
|
|
170
170
|
timeout: new Date().getTime()
|
|
171
171
|
})
|
|
172
172
|
|
|
@@ -186,8 +186,7 @@ export type MilkioHTTPRequest = {
|
|
|
186
186
|
export type MilkioHTTPResponse = Mixin<
|
|
187
187
|
ResponseInit,
|
|
188
188
|
{
|
|
189
|
-
|
|
190
|
-
body: string;
|
|
189
|
+
body: string | BodyInit;
|
|
191
190
|
status: number;
|
|
192
191
|
headers: Record<string, string>;
|
|
193
192
|
}
|