This commit is contained in:
@@ -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 }")
|
||||
|
||||
Reference in New Issue
Block a user