This commit is contained in:
2025-07-07 08:28:51 +09:00
parent ebcc535cf1
commit 9c1efbf047
3 changed files with 41 additions and 4 deletions
@@ -20,7 +20,7 @@ class PreviewController < ApplicationController
return head :unauthorized unless current_user
url = params[:url]
return head :bad_request unless url.present?
return head :bad_request if url.blank?
path = Rails.root.join('tmp', "thumb_#{ SecureRandom.hex }.png")
system("node #{ Rails.root }/lib/screenshot.js #{ Shellwords.escape(url) } #{ path }")