mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-02 04:56:07 +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.
|
||||
* @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.
|
||||
|
@ -195,9 +195,11 @@ export class HttpClient extends BaseClient {
|
||||
}
|
||||
|
||||
r(
|
||||
Response.json(response, {
|
||||
headers,
|
||||
}),
|
||||
response instanceof FormData
|
||||
? new Response(response, { headers })
|
||||
: Response.json(response, {
|
||||
headers,
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user