Skip to content

Commit

Permalink
don't strip the query strings
Browse files Browse the repository at this point in the history
  • Loading branch information
carlhoerberg committed Feb 25, 2012
1 parent 6dce888 commit 9d12bf2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/sprockets-urlrewriter.rb
Expand Up @@ -16,7 +16,7 @@ def evaluate(context, locals)
data.gsub /url\(['"]?([^\s)]+\.[a-z]+)(\?\d+)?['"]?\)/ do |url|
next url if URI.parse($1).absolute?
new_path = rel.join Pathname.new($1)
"url(#{new_path})"
"url(#{new_path}#{$2})"
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/urlrewriter_spec.rb
Expand Up @@ -8,7 +8,7 @@

it 'finds relatives urls and makes them absolute' do
@css = "body { background-url: url('bg.jpg?1232') }"
assert_equal "body { background-url: url(/assets/css/bg.jpg) }", subject
assert_equal "body { background-url: url(/assets/css/bg.jpg?1232) }", subject
end

it 'leaves absolute URLs as is' do
Expand Down

0 comments on commit 9d12bf2

Please sign in to comment.