Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

rewrite_asset_path should respect already existing query strings

#3245

Fix:

  def rewrite_asset_path(source)
    asset_id = rails_asset_id(source)
    if asset_id.blank?
      source
    else
      source + "#{source.include?('?') ? '&' : '?'}#{asset_id}"
    end
  end

Reported by niko · September 22nd, 2009 @ 10:45 AM

State: stale
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. CancelProfileIsBroken
    CancelProfileIsBroken
    • Tag changed from 2.3.2, asset_tag_helper to 2.3.2, asset_tag_helper, bugmash

    September 25th, 2009 @ 11:54 AM

  2. John Pignata
    John Pignata

    -1 - rewrite_asset_path is private and probably shouldn't be enhanced directly without /good/ reason. The one call to this method I see is from compute_public_path which seems to not call this method if the string is URL-like. What problem is this bug report trying to solve?

    September 27th, 2009 @ 04:34 AM

  3. Mike Enriquez
    Mike Enriquez
    1. I agree with John. I can't think of a use for a dynamic asset that would need a query string. More info would be helpful.

    September 27th, 2009 @ 07:01 PM

  4. niko
    niko

    We're using #compute_public_path for some downloadable assets, where the filename of the downloaded file must be different than the filename on the server. So the webpath looks like this:

    /resources/audio/af/A%20nice%20Song.mp3?filename=af12345.mpga

    Obviously we want the files served by our asset-servers.

    I would really like it if #compute_public_path as well as #compute_asset_host and #rewrite_asset_path were public.

    September 27th, 2009 @ 07:16 PM

  5. Rizwan Reza
    Rizwan Reza
    • Tag changed from 2.3.2, asset_tag_helper, bugmash to 2.3.2, asset_tag_helper

    February 12th, 2010 @ 12:46 PM

  6. Rohit Arondekar
    Rohit Arondekar
    • State changed from new to stale
    • Importance changed from to

    Marking ticket as stale. If this is still an issue please leave a comment with suggested changes, creating a patch with tests, rebasing an existing patch or just confirming the issue on a latest release or master/branches.

    February 2nd, 2011 @ 10:21 AM