From ad03c88a97580e6af1f13cdab98c06dcccc41bec Mon Sep 17 00:00:00 2001 From: Neetpone <132411956+Neetpone@users.noreply.github.com> Date: Sat, 13 Apr 2024 21:04:32 -0400 Subject: [PATCH] fix: fix content-type and cache-control headers for images --- app/controllers/images_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/images_controller.rb b/app/controllers/images_controller.rb index 4702dc7..4a69ae7 100644 --- a/app/controllers/images_controller.rb +++ b/app/controllers/images_controller.rb @@ -26,7 +26,8 @@ class ImagesController < ApplicationController File.binwrite path, body end - send_file path, disposition: :inline, content_type: content_type + response.headers['Cache-Control'] = 'public' + send_file path, disposition: :inline, type: content_type end private