mirror of
https://github.com/rikkaneko/paste.git
synced 2025-06-06 16:45:41 +00:00
Fix MIME type detection from HTTP form requests
Signed-off-by: Joe Ma <rikkaneko23@gmail.com>
This commit is contained in:
parent
1ec2a9f7f0
commit
d79281a6c6
1 changed files with 4 additions and 2 deletions
|
@ -120,9 +120,11 @@ export default {
|
|||
}
|
||||
// File
|
||||
if (data instanceof File) {
|
||||
title = data.name ?? undefined;
|
||||
if (data.name) {
|
||||
title = data.name;
|
||||
mime = contentType(title) || undefined;
|
||||
}
|
||||
buffer = await data.arrayBuffer();
|
||||
mime = data.type;
|
||||
// Text
|
||||
} else {
|
||||
buffer = new TextEncoder().encode(data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue