Commit 46f3bb5c authored by nanahira's avatar nanahira

fix file download

parent 9d56016d
Pipeline #17702 failed with stages
in 44 seconds
{ {
"name": "koishi-plugin-pics", "name": "koishi-plugin-pics",
"description": "Koishi 的随机图片插件", "description": "Koishi 的随机图片插件",
"version": "10.3.0", "version": "10.3.1",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/src/index.d.ts", "types": "dist/src/index.d.ts",
"scripts": { "scripts": {
......
...@@ -186,10 +186,8 @@ export default class PicsContainer ...@@ -186,10 +186,8 @@ export default class PicsContainer
if (url.startsWith('base64://')) { if (url.startsWith('base64://')) {
return Buffer.from(url.slice(9), 'base64'); return Buffer.from(url.slice(9), 'base64');
} }
return this._http.get<Buffer>(url, { const { data } this._http.file(url);
responseType: 'arraybuffer', return data;
...extraConfig,
});
} }
bufferToUrl(buffer: Buffer) { bufferToUrl(buffer: Buffer) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment