@midwayjs/mock 3.10.11 → 3.10.13
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.
- package/dist/creator.js +7 -2
- package/package.json +2 -2
package/dist/creator.js
CHANGED
|
@@ -262,7 +262,7 @@ async function createFunctionApp(baseDir = process.cwd(), options = {}, customFr
|
|
|
262
262
|
const result = await framework.invokeTriggerFunction(ctx, url.pathname, {
|
|
263
263
|
isHttpFunction: true,
|
|
264
264
|
});
|
|
265
|
-
const { statusCode, headers, body } = result;
|
|
265
|
+
const { statusCode, headers, body, isBase64Encoded } = result;
|
|
266
266
|
if (res.headersSent) {
|
|
267
267
|
return;
|
|
268
268
|
}
|
|
@@ -273,7 +273,12 @@ async function createFunctionApp(baseDir = process.cwd(), options = {}, customFr
|
|
|
273
273
|
res.statusCode = statusCode;
|
|
274
274
|
}
|
|
275
275
|
// http trigger only support `Buffer` or a `string` or a `stream.Readable`
|
|
276
|
-
|
|
276
|
+
if (isBase64Encoded && typeof body === 'string') {
|
|
277
|
+
res.end(Buffer.from(body, 'base64'));
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
res.end(body);
|
|
281
|
+
}
|
|
277
282
|
};
|
|
278
283
|
};
|
|
279
284
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/mock",
|
|
3
|
-
"version": "3.10.
|
|
3
|
+
"version": "3.10.13",
|
|
4
4
|
"description": "create your test app from midway framework",
|
|
5
5
|
"main": "dist/index",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"type": "git",
|
|
50
50
|
"url": "https://github.com/midwayjs/midway.git"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "6052ab52c7973f092a4acc943707d7b4cac16bd2"
|
|
53
53
|
}
|