aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/asset_url_helper.rb
diff options
context:
space:
mode:
authorDavid Celis <me@davidcel.is>2013-06-16 16:57:49 -0700
committerDavid Celis <me@davidcel.is>2013-06-16 16:57:49 -0700
commit8fc3427646e932c3a1fb9f9794364866f030595e (patch)
tree1738867b5c15c00206fda3dc209837fafb6ee84a /actionpack/lib/action_view/helpers/asset_url_helper.rb
parent0f89689b2357f39da52515b83391db58689a1361 (diff)
downloadrails-8fc3427646e932c3a1fb9f9794364866f030595e.tar.gz
rails-8fc3427646e932c3a1fb9f9794364866f030595e.tar.bz2
rails-8fc3427646e932c3a1fb9f9794364866f030595e.zip
Use a case insensitive URI Regexp for #asset_path
Context: https://gist.github.com/radar/5793814 The `URI_REGEXP` that various AssetUrl helpers use is currently case sensitive when checking for a URI scheme. This means if you try to pass a URL like `HTTP://www.example.com/path/to/image.jpg`, you end up with a bogus asset path: `/assets/HTTP://www.example.com/path/to/image.jpg`. URLs are case insensitive, so this regexp should be as well. Signed-off-by: David Celis <me@davidcel.is>
Diffstat (limited to 'actionpack/lib/action_view/helpers/asset_url_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/asset_url_helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/asset_url_helper.rb b/actionpack/lib/action_view/helpers/asset_url_helper.rb
index b5f2df76ab..0b957adb91 100644
--- a/actionpack/lib/action_view/helpers/asset_url_helper.rb
+++ b/actionpack/lib/action_view/helpers/asset_url_helper.rb
@@ -105,7 +105,7 @@ module ActionView
# )
#
module AssetUrlHelper
- URI_REGEXP = %r{^[-a-z]+://|^(?:cid|data):|^//}
+ URI_REGEXP = %r{^[-a-z]+://|^(?:cid|data):|^//}i
# Computes the path to asset in public directory. If :type
# options is set, a file extension will be appended and scoped