added test upload
This commit is contained in:
parent
bc7b0e6773
commit
7846686757
@ -65,10 +65,7 @@ export default {
|
||||
Key: key,
|
||||
});
|
||||
|
||||
const presignedUrl = await getSignedUrl(client, command, {
|
||||
expiresIn: 3600,
|
||||
unhoistableHeaders: new Set(['x-amz-content-sha256']),
|
||||
});
|
||||
const presignedUrl = await getSignedUrl(client, command, { expiresIn: 3600 });
|
||||
|
||||
return json({ url: presignedUrl, key }, 200, cors);
|
||||
} catch (err) {
|
||||
|
||||
@ -52,10 +52,7 @@ describe('R2 upload', () => {
|
||||
|
||||
const uploadRes = await fetch(url, {
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
'Content-Type': 'image/png',
|
||||
'x-amz-content-sha256': 'UNSIGNED-PAYLOAD',
|
||||
},
|
||||
headers: { 'Content-Type': 'image/png' },
|
||||
body: IMAGE,
|
||||
});
|
||||
|
||||
|
||||
BIN
pictures/image2.png
Normal file
BIN
pictures/image2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 489 KiB |
Loading…
Reference in New Issue
Block a user