mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-02 21:16:09 +00:00
fix: files support cloudfare workers
This commit is contained in:
parent
49c26c44d0
commit
d1fb9a88f4
@ -38,7 +38,9 @@ export class AttachmentBuilder {
|
|||||||
* Creates a new Attachment instance.
|
* Creates a new Attachment instance.
|
||||||
* @param data - The partial attachment data.
|
* @param data - The partial attachment data.
|
||||||
*/
|
*/
|
||||||
constructor(public data: Partial<AttachmentData> = { name: `${randomBytes(8).toString('base64url')}.jpg` }) {}
|
constructor(
|
||||||
|
public data: Partial<AttachmentData> = { name: `${randomBytes?.(8)?.toString('base64url') || 'default'}.jpg` },
|
||||||
|
) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the name of the attachment.
|
* Sets the name of the attachment.
|
||||||
|
@ -195,9 +195,11 @@ export class HttpClient extends BaseClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
r(
|
r(
|
||||||
Response.json(response, {
|
response instanceof FormData
|
||||||
headers,
|
? new Response(response, { headers })
|
||||||
}),
|
: Response.json(response, {
|
||||||
|
headers,
|
||||||
|
}),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user