Fix json downloading for Safari

rails
Marcin Kulik 8 years ago
parent 56cea2fb39
commit aedb04a90e

@ -11,7 +11,12 @@ class AsciicastSerializer < ActiveModel::Serializer
if v0_url?
object.stdout_frames_url
else
asciicast_path(object, format: :json)
url = object.data.url
if url.starts_with?("/")
asciicast_path(object, format: :json) # download URL for local carrierwave store
else
url # direct signed S3 URL (because XHR CORS redirect doesn't work under Safari)
end
end
end

Loading…
Cancel
Save