fix(drive/idempotence): MisskeyIO#683 (MisskeyIO#687)

This commit is contained in:
まっちゃとーにゅ 2024-08-12 12:13:07 +09:00 committed by GitHub
parent 5a9d8a5564
commit 8c6a25acb7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -113,7 +113,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
throw new ApiError(meta.errors.invalidParam);
}
const calcHash = createHash('sha256').update(`${ps.folderId}:${ps.isSensitive}`);
const calcHash = createHash('sha256').update(`${ps.folderId}:${ps.name}:${ps.isSensitive}`);
await stream.pipeline(fs.createReadStream(file.path, { encoding: 'binary', start: 0, end: 1024 * 1024 }), calcHash);
const hash = calcHash.digest('base64');
logger.setContext({ userId: me.id, hash, ip, headers });