All pastes #430688 Raw Edit

Untitled

public text v1 · immutable
·published 2007-04-09 05:17 UTC
rendered paste body
  def retrieve
    #render :text=>@req_url
    #return
    uri = URI.parse(@req_url) # <base href="http://www.codeave.com">
    base_href_html = "<base href='#{uri.scheme}://#{uri.host}#{':'+uri.port if uri.port!=80}/' />"
    doc = Hpricot(@corresponding_entry.content_cache)
    doc.search('head').prepend(base_href_html) unless ((bs=doc.at('base')) and bs[:href])
    render :text=>doc.to_s
  end