added test upload
This commit is contained in:
parent
bc7b0e6773
commit
7846686757
@ -65,10 +65,7 @@ export default {
|
|||||||
Key: key,
|
Key: key,
|
||||||
});
|
});
|
||||||
|
|
||||||
const presignedUrl = await getSignedUrl(client, command, {
|
const presignedUrl = await getSignedUrl(client, command, { expiresIn: 3600 });
|
||||||
expiresIn: 3600,
|
|
||||||
unhoistableHeaders: new Set(['x-amz-content-sha256']),
|
|
||||||
});
|
|
||||||
|
|
||||||
return json({ url: presignedUrl, key }, 200, cors);
|
return json({ url: presignedUrl, key }, 200, cors);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
@ -52,10 +52,7 @@ describe('R2 upload', () => {
|
|||||||
|
|
||||||
const uploadRes = await fetch(url, {
|
const uploadRes = await fetch(url, {
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
headers: {
|
headers: { 'Content-Type': 'image/png' },
|
||||||
'Content-Type': 'image/png',
|
|
||||||
'x-amz-content-sha256': 'UNSIGNED-PAYLOAD',
|
|
||||||
},
|
|
||||||
body: IMAGE,
|
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