<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -90,9 +90,13 @@ module ActionController #:nodoc:
 
       def follow_redirect_with_headers(h = {})
         raise &quot;Not a redirect! #{@status} #{@status_message}&quot; unless redirect?
-        h['HTTP_REFERER'] = current_url if current_url
 
-        get(interpret_uri(headers[&quot;location&quot;].first), {}, h)
+        h['HTTP_REFERER'] = request.url
+
+        location = headers[&quot;location&quot;]
+        location = location.first if location.is_a?(Array)
+        
+        get(location, {}, h)
         status
       end
     end</diff>
      <filename>lib/webrat/rails.rb</filename>
    </modified>
    <modified>
      <diff>@@ -131,6 +131,7 @@ describe ActionController::Integration::Session do
   before :each do
     Webrat.configuration.mode = :rails
     @integration_session = ActionController::Integration::Session.new
+    @integration_session.stub!(:request =&gt; mock(&quot;request&quot;, :url =&gt; &quot;http://source.url/&quot;))
     @integration_session.stub!(:response =&gt; mock(&quot;response&quot;))
   end
 
@@ -167,8 +168,6 @@ describe ActionController::Integration::Session do
     end
 
     it &quot;should set the HTTP referer header&quot; do
-      @integration_session.stub!(:current_url).and_return &quot;http://source.url/&quot;
-
       headers = {}
 
       @integration_session.follow_redirect_with_headers(headers)</diff>
      <filename>spec/webrat/rails/rails_session_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>29274f9b4b49f98a6d69f43d1b3a309146912bc3</id>
    </parent>
  </parents>
  <author>
    <name>Josh Knowles</name>
    <email>joshknowles@gmail.com</email>
  </author>
  <url>http://github.com/brynary/webrat/commit/4b6558e7e5c5b5cf9d7d6dae3368715c8d4b9d43</url>
  <id>4b6558e7e5c5b5cf9d7d6dae3368715c8d4b9d43</id>
  <committed-date>2008-12-28T18:12:34-08:00</committed-date>
  <authored-date>2008-12-28T17:53:33-08:00</authored-date>
  <message>Properly set referer and redirect to proper location</message>
  <tree>af3383d741c1598c950c94a9916ce497566188c1</tree>
  <committer>
    <name>Josh Knowles</name>
    <email>joshknowles@gmail.com</email>
  </committer>
</commit>
