From 6b985d778b711012d9e7709dbee8d5abd2c30122 Mon Sep 17 00:00:00 2001 From: f Date: Tue, 18 Aug 2020 10:13:57 -0300 Subject: [PATCH] =?UTF-8?q?agregar=20cach=C3=A9=20a=20la=20imagen=20por=20?= =?UTF-8?q?la=20duraci=C3=B3n=20de=20la=20cookie=20#75?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/api/v1/invitades_controller.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/controllers/api/v1/invitades_controller.rb b/app/controllers/api/v1/invitades_controller.rb index 2951b20..eb2a4f2 100644 --- a/app/controllers/api/v1/invitades_controller.rb +++ b/app/controllers/api/v1/invitades_controller.rb @@ -56,12 +56,13 @@ module Api # # Enviamos un token de protección CSRF def set_cookie + # TODO: Volver configurable por sitio + expires = ENV.fetch('COOKIE_DURATION', '30').to_i.minutes + headers['Access-Control-Allow-Origin'] = return_origin headers['Access-Control-Allow-Credentials'] = true headers['Vary'] = 'Origin' - - # TODO: Volver configurable por sitio - expires = ENV.fetch('COOKIE_DURATION', '30').to_i.minutes + headers['Cache-Control'] = "private, max-age=#{expires}, stale-while-revalidate=#{expires}" cookies.encrypted[site_id] = { httponly: true,