Revert "Returning proper URLs in JSON even if behind a proxy"

This reverts commit ac41401b85.
This commit is contained in:
Christoph Haas 2016-07-19 16:52:01 +02:00
parent ac41401b85
commit f6c7973435
2 changed files with 4 additions and 4 deletions

View file

@ -1,7 +1,7 @@
json.package @p.name
json.screenshots @p.screenshots do |s|
json.small_image_url "https://#{request.env['HTTP_HOST']}#{s.image.url(:thumb, timestamp: false)}"
json.large_image_url "https://#{request.env['HTTP_HOST']}#{s.image.url(:large, timestamp: false)}"
json.small_image_url "#{request.protocol}#{request.host_with_port}#{s.image.url(:thumb, timestamp: false)}"
json.large_image_url "#{request.protocol}#{request.host_with_port}#{s.image.url(:large, timestamp: false)}"
json.version s.version
end

View file

@ -4,7 +4,7 @@ json.cache! ['json_screenshots'], expires_in: 1.hour do
json.extract! s, :version
json.extract! p, :maintainer, :name, :section, :maintainer_email, :homepage, :description
json.url package_url(p.name)
json.small_image_url "https://#{request.env['HTTP_HOST']}#{s.image.url(:thumb, timestamp: false)}"
json.large_image_url "https://#{request.env['HTTP_HOST']}#{s.image.url(:large, timestamp: false)}"
json.small_image_url "#{request.protocol}#{request.host_with_port}#{s.image.url(:thumb, timestamp: false)}"
json.large_image_url "#{request.protocol}#{request.host_with_port}#{s.image.url(:large, timestamp: false)}"
end
end