diff --git a/app/services/application_service.rb b/app/services/application_service.rb index 81c48de95..6bf1c807a 100644 --- a/app/services/application_service.rb +++ b/app/services/application_service.rb @@ -9,6 +9,10 @@ class ApplicationService content.gsub(regex, '') end + def convert_https content + content.gsub("http:", "https:") + end + private def strip(str) diff --git a/app/services/videos/dispatch_callback_service.rb b/app/services/videos/dispatch_callback_service.rb index 1c1b93572..5adebea73 100644 --- a/app/services/videos/dispatch_callback_service.rb +++ b/app/services/videos/dispatch_callback_service.rb @@ -12,7 +12,7 @@ class Videos::DispatchCallbackService < ApplicationService # TODO:: 拆分事件分发 case params['EventType'] when 'FileUploadComplete' then # 视频上传完成 - video.file_url = params['FileUrl'].gsub("http:", "https:") + video.file_url = convert_https(params['FileUrl']) video.filesize = params['Size'] video.upload_success video.save!