aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorChad Krsek <chad.krsek@gmail.com>2011-04-26 11:50:08 -0700
committerChad Krsek <chad.krsek@gmail.com>2011-04-26 11:50:08 -0700
commitc15108ce063f6396a6e93a54e973b858d0280d41 (patch)
treed60221cd24c2eccf168f0c40440f59f49755e778 /actionpack
parentb49a1192d3d7f2dffff742fc154c8b3d2533b621 (diff)
downloadrails-c15108ce063f6396a6e93a54e973b858d0280d41.tar.gz
rails-c15108ce063f6396a6e93a54e973b858d0280d41.tar.bz2
rails-c15108ce063f6396a6e93a54e973b858d0280d41.zip
moving check fo scheme-relative URI into is_uri?
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_view/helpers/asset_paths.rb11
1 files changed, 2 insertions, 9 deletions
diff --git a/actionpack/lib/action_view/helpers/asset_paths.rb b/actionpack/lib/action_view/helpers/asset_paths.rb
index 0429e60cd5..cb6737b94e 100644
--- a/actionpack/lib/action_view/helpers/asset_paths.rb
+++ b/actionpack/lib/action_view/helpers/asset_paths.rb
@@ -18,7 +18,7 @@ module ActionView
# asset host, if configured, with the correct request protocol.
def compute_public_path(source, dir, ext = nil, include_host = true)
source = source.to_s
- return source if is_uri?(source) || is_scheme_relative_uri?(source)
+ return source if is_uri?(source)
source = rewrite_extension(source, dir, ext) if ext
source = "/#{dir}/#{source}" unless source[0] == ?/
@@ -33,14 +33,7 @@ module ActionView
end
def is_uri?(path)
- path =~ %r{^[-a-z]+://|^cid:}
- end
-
- # A URI relative to a base URI's scheme?
- # See http://labs.apache.org/webarch/uri/rfc/rfc3986.html#relative-normal
- # "//g" => "http://g"
- def is_scheme_relative_uri?(path)
- path =~ %r{^//}
+ path =~ %r{^[-a-z]+://|^cid:|^//}
end
private