normalize file urls
This commit is contained in:
committed by
Pete Matsyburka
parent
fc11078cae
commit
44a49a4533
@@ -35,7 +35,7 @@ class TemplatesUploadsController < ApplicationController
|
||||
def create_file_params_from_url
|
||||
tempfile = Tempfile.new
|
||||
tempfile.binmode
|
||||
tempfile.write(conn.get(params[:url]).body)
|
||||
tempfile.write(conn.get(Addressable::URI.parse(params[:url]).display_uri.to_s).body)
|
||||
tempfile.rewind
|
||||
|
||||
file = ActionDispatch::Http::UploadedFile.new(
|
||||
|
||||
@@ -71,7 +71,7 @@ module Submitters
|
||||
|
||||
return blob if blob
|
||||
|
||||
data = conn.get(url).body
|
||||
data = conn.get(Addressable::URI.parse(url).display_uri.to_s).body
|
||||
|
||||
checksum = Digest::MD5.base64digest(data)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user