GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If a CDN can be dynamically enabled in an app, when it is switched off and the asset_host proc returns nil, all asset urls are relative instead of absolute. This fix makes the urls absolute.
Per @pixeltrix's comment, please also assert that asset_path looks right here. (Though at a glance, it sounds like it will.)
Is this looking better or have I misunderstood?
assert_equal "/images/rails.png", image_path("rails.png")
.. just as a direct contrast to image_url, because the other similar test that I saw doesn't set up base_url.
Cool, makes sense
@jpawlyn can you squash your commits and add an entry to CHANGELOG - thanks.
Return an absolute instead of relative path from an asset url in the …
…case of the `asset_host` proc returning nil
@pixeltrix All done
@jpawlyn okay, thanks - just waiting on the CI and then I'll do the backports to 4-1-stable and 4-0-stable.
Merge pull request #16161 from jpawlyn/master
Fix empty host for an asset url when asset_host proc returns nil
Backported to 4-1-stable (08e528d) and 4-0-stable (0997ceb)