Module: Gitlab::AssetProxy

Defined in:
lib/gitlab/asset_proxy.rb

Class Method Summary collapse

Class Method Details

.proxy_url(url) ⇒ Object


9
10
11
12
13
14
15
16
# File 'lib/gitlab/asset_proxy.rb', line 9

def proxy_url(url)
  return url unless Gitlab.config.asset_proxy.enabled
  return url if asset_host_whitelisted?(url)

  "#{Gitlab.config.asset_proxy.url}/#{asset_url_hash(url)}/#{hexencode(url)}"
rescue Addressable::URI::InvalidURIError
  url
end