fix(core): validate file sharing requests
Keep QQ share-code lookups on a bounded and predictable request path while preserving existing successful usage through plain codes and official links. Reject unsupported inputs early, align operator-facing action documentation, and add regression coverage for valid links, malformed responses, and resource limits.
This commit is contained in:
5 files changed
+229
-12
No files matched your search
@@ -2605,7 +2605,7 @@ export const actions = [
|
||||
|
||||
defineAction({
|
||||
name: 'get_fileset_id',
|
||||
summary: '从分享码/链接获取 fileset_id',
|
||||
summary: '从 QQ 闪传分享码或官方分享链接获取 fileset_id',
|
||||
readOnly: true,
|
||||
returns: '{ fileset_id }:解析出的文件集 ID。',
|
||||
returnsSchema: {
|
||||
@@ -2615,7 +2615,10 @@ export const actions = [
|
||||
},
|
||||
required: ['fileset_id'],
|
||||
},
|
||||
params: { share_code: f.string({ allowEmpty: false }) },
|
||||
params: {
|
||||
share_code: f.string({ allowEmpty: false })
|
||||
.describe('QQ 闪传分享码,或 https://qfile.qq.com/q/... 官方分享链接'),
|
||||
},
|
||||
run: async (p, ctx) => {
|
||||
const filesetId = await ctx.bridge.apis.flashTransfer.getFilesetIdByCode(p.share_code);
|
||||
return okResponse({ fileset_id: filesetId });
|
||||
|
||||
Reference in new issue
Block a user