转换Https

dev_aliyun2
daiao 5 years ago committed by harry
parent b7212450e3
commit f3e86aef54

@ -9,6 +9,10 @@ class ApplicationService
content.gsub(regex, '') content.gsub(regex, '')
end end
def convert_https content
content.gsub("http:", "https:")
end
private private
def strip(str) def strip(str)

@ -12,7 +12,7 @@ class Videos::DispatchCallbackService < ApplicationService
# TODO:: 拆分事件分发 # TODO:: 拆分事件分发
case params['EventType'] case params['EventType']
when 'FileUploadComplete' then # 视频上传完成 when 'FileUploadComplete' then # 视频上传完成
video.file_url = params['FileUrl'].gsub("http:", "https:") video.file_url = convert_https(params['FileUrl'])
video.filesize = params['Size'] video.filesize = params['Size']
video.upload_success video.upload_success
video.save! video.save!

Loading…
Cancel
Save