Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
config.action_controller.asset_host = Proc.new do |source, request|
non_ssl_host = "http://asset#{source.hash % 4}.backpackit.com"
ssl_host = "https://asset1.backpackit.com"
if request.ssl?
case
when source =~ /\.js$/
ssl_host
when request.headers["USER_AGENT"] =~ /(Safari)/
non_ssl_host
when request.headers["USER_AGENT"] =~ /Firefox/ && source =~ /^\/images/
non_ssl_host
else
ssl_host
end
else
non_ssl_host
end
end
@v0000oooooooo

This comment has been minimized.

Copy link

v0000oooooooo commented Mar 23, 2018

[@](`

url

`)

@teerasak182530

This comment has been minimized.

Copy link

teerasak182530 commented Apr 6, 2019

[@](`

url

`)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.