Skip to content

Commit

Permalink
🚑 Move cache control header into the post policy
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Nov 2, 2023
1 parent bdf9fae commit a855d85
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export const UploadButton = ({
Object.entries(data.formData).forEach(([key, value]) => {
formData.append(key, value)
})
formData.append('Cache-Control', 'max-age=86400')
formData.append('file', file)
const upload = await fetch(data.presignedUrl, {
method: 'POST',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export const uploadFiles = async ({
Object.entries(data.formData).forEach(([key, value]) => {
formData.append(key, value)
})
formData.append('Cache-Control', 'max-age=86400')
formData.append('file', file)
const upload = await fetch(data.presignedUrl, {
method: 'POST',
Expand Down
2 changes: 1 addition & 1 deletion packages/embeds/js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typebot.io/js",
"version": "0.2.12",
"version": "0.2.13",
"description": "Javascript library to display typebots on your website",
"type": "module",
"main": "dist/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export const uploadFiles = async ({
Object.entries(data.formData).forEach(([key, value]) => {
formData.append(key, value)
})
formData.append('Cache-Control', 'max-age=86400')
formData.append('file', file)
const upload = await fetch(data.presignedUrl, {
method: 'POST',
Expand Down
2 changes: 1 addition & 1 deletion packages/embeds/nextjs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typebot.io/nextjs",
"version": "0.2.12",
"version": "0.2.13",
"description": "Convenient library to display typebots on your Next.js website",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/embeds/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typebot.io/react",
"version": "0.2.12",
"version": "0.2.13",
"description": "Convenient library to display typebots on your React app",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 2 additions & 0 deletions packages/lib/s3/generatePresignedPostPolicy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ export const generatePresignedPostPolicy = async ({
postPolicy.setKey(filePath)
postPolicy.setBucket(env.S3_BUCKET)
postPolicy.setExpires(new Date(Date.now() + tenMinutes * 1000))
postPolicy.formData['Cache-Control'] = 'max-age=86400'
postPolicy.policy.conditions.push(['eq', '$Cache-Control', 'max-age=86400'])
if (fileType) postPolicy.setContentType(fileType)

return minioClient.presignedPostPolicy(postPolicy)
Expand Down

3 comments on commit a855d85

@vercel
Copy link

@vercel vercel bot commented on a855d85 Nov 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

builder-v2 – ./apps/builder

app.typebot.io
builder-v2-typebot-io.vercel.app
builder-v2-git-main-typebot-io.vercel.app

@vercel
Copy link

@vercel vercel bot commented on a855d85 Nov 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on a855d85 Nov 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

viewer-v2 – ./apps/viewer

vhpage.cr8.ai
vitamyway.com
whatchat.site
www.wiccom.it
acessovip.shop
adsgrow.com.br
am.nigerias.io
an.nigerias.io
app.yvon.earth
ar.nigerias.io
bot.enreso.org
bot.mail2wa.me
bot.rslabs.pro
bot.share5.net
bots.bng.tools
bot.artiweb.app
bot.devitus.com
bot.reeplai.com
bot.scayver.com
bot.tc-mail.com
carspecs.lam.ee
chat.borang.net
chat.lalmon.com
chat.sureb4.com
conversawpp.com
eventhub.com.au
feiraododia.com
fitness.riku.ai
games.klujo.com
iludogaming.com
ironcitygym.com
localove.online
marksteward.org
mikestuward.org
projektelco.com
proscale.com.br
sellmycarbr.com
sniperclass.com
svhmapp.mprs.in
tanjakoil.store
typebot.aloe.do
web.ofilipi.com
acordo-certo.com
app-liberado.pro
ask.pemantau.org
batepapo.digital
bot.contakit.com
bot.imovfast.com
bot.lafabri.link
bot.piccinato.co
chat.sifucrm.com
chat.syncwin.com
chatonlineja.com
clo.closeer.work
cockroach.cr8.ai
demo.chatjer.com
desafioem21d.com
digitando.online
faqs.nigerias.io
feiraodehoje.com
georgemarttt.com
go.chatbotcv.com
guiascore900.com
haymanevents.com
viewer-v2-typebot-io.vercel.app
mdb.evento.autocadastro.progenbr.com
form.shopmercedesbenzsouthorlando.com
mdb.evento.equipeinterna.progenbr.com
bot.studiotecnicoimmobiliaremerelli.it
mdb.assessoria.boaventura.progenbr.com
mdb.assessoria.jtrebesqui.progenbr.com
pesquisa.escolamodacomproposito.com.br
anamnese.clinicaramosodontologia.com.br
gabinete.baleia.formulario.progenbr.com
mdb.assessoria.carreirinha.progenbr.com
chrome-os-inquiry-system.itschromeos.com
mdb.assessoria.paulomarques.progenbr.com
viewer-v2-git-main-typebot-io.vercel.app
main-menu-for-itschromeos.itschromeos.com
mdb.assessoria.qrcode.ademir.progenbr.com
mdb.assessoria.qrcode.arthur.progenbr.com
mdb.assessoria.qrcode.danilo.progenbr.com
mdb.assessoria.qrcode.marcao.progenbr.com
mdb.assessoria.qrcode.marcio.progenbr.com
mdb.assessoria.qrcode.aloisio.progenbr.com
mdb.assessoria.qrcode.girotto.progenbr.com
mdb.assessoria.qrcode.marinho.progenbr.com
mdb.assessoria.qrcode.rodrigo.progenbr.com
mdb.assessoria.carlosalexandre.progenbr.com
mdb.assessoria.qrcode.desideri.progenbr.com
mdb.assessoria.qrcode.fernanda.progenbr.com
mdb.assessoria.qrcode.jbatista.progenbr.com
mdb.assessoria.qrcode.mauricio.progenbr.com
mdb.assessoria.fernanda.regional.progenbr.com
mdb.assessoria.qrcode.boaventura.progenbr.com
mdb.assessoria.qrcode.jtrebesqui.progenbr.com
mdb.assessoria.qrcode.carreirinha.progenbr.com
mdb.assessoria.qrcode.paulomarques.progenbr.com
mdb.assessoria.qrcode.carlosalexandre.progenbr.com
mdb.assessoria.qrcode.fernanda.regional.progenbr.com

Please sign in to comment.