Updated news, trends image url path in redux

• Updated:
- news, trends image url path in redux
This commit is contained in:
mgabdev
2020-11-09 12:00:37 -06:00
parent d24b5a7b0e
commit f175b640f0
3 changed files with 16 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
require 'base64'
require 'net/http'
class Api::V2::ImageProxyController < EmptyController
def get
if params[:trends_url].nil?
raise GabSocial::NotPermittedError
else
url = URI.parse(params[:trends_url])
image = Net::HTTP.get_response(url)
send_data image.body, type: image.content_type, disposition: 'inline'
end
end
end