When using compute_source_path to determine the full path of an
asset, if our source begins with '/', we don't want to include
the directory. Examples are illustrative:
> compute_source_path("foo", "stylesheets", "css")
=> "/Users/steve/src/my_app/public/stylesheets/foo.css"
> compute_source_path("/foo", "stylesheets", "css")
=> "/Users/steve/src/my_app/public/foo.css"
Before this patch, the second example would return the same as the
first.
Fixes#5680.
That integer is rather irrelevant, the only thing that matters is that
it is consistent and with no apparent bias. Zlib.crc32 is 8-10 times
faster than bytes.sum, so use that.
config.action_controller.default_asset_host_protocol
It's best to leave this unset.
When unset the :request protocol is used whenever it can be and
:relative is used in the other situations.
When set to :request then assets hosts will be disabled when there
is no request in scope and will use the request protocol whenever a
request is in scope.
If set to :relative, then a relative protocol is always used except
for stylesheet link tags which must use the :request protocol to
avoid double downloads in IE6&7.
Conflicts:
actionpack/lib/sprockets/helpers/rails_helper.rb
actionpack/test/template/sprockets_helper_test.rb