mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 18:54:58 +00:00
fix: enforce inbound media max-bytes during remote fetch
This commit is contained in:
@@ -218,6 +218,7 @@ async function appendResolvedMediaFromAttachments(params: {
|
||||
const fetched = await fetchRemoteMedia({
|
||||
url: attachment.url,
|
||||
filePathHint: attachment.filename ?? attachment.url,
|
||||
maxBytes: params.maxBytes,
|
||||
});
|
||||
const saved = await saveMediaBuffer(
|
||||
fetched.buffer,
|
||||
@@ -307,6 +308,7 @@ async function appendResolvedMediaFromStickers(params: {
|
||||
const fetched = await fetchRemoteMedia({
|
||||
url: candidate.url,
|
||||
filePathHint: candidate.fileName,
|
||||
maxBytes: params.maxBytes,
|
||||
});
|
||||
const saved = await saveMediaBuffer(
|
||||
fetched.buffer,
|
||||
|
||||
Reference in New Issue
Block a user