Set content type on uploaded image

This makes it so the image doesn't auto-download when opened in a new tab
This commit is contained in:
Austin Chen 2022-10-04 20:48:19 -04:00
parent 296d85b4cd
commit c2fa9cb4c4

View File

@ -71,6 +71,7 @@ async function upload(buffer: Buffer) {
const storageRef = ref(storage, `dream/${filename}`)
const uploadTask = uploadBytesResumable(storageRef, buffer, {
cacheControl: `public, max-age=${ONE_YEAR_SECS}`,
contentType: 'image/png',
})
let resolvePromise: (url: string) => void