#213 open

HTTP Referer corruption causing redirects to not be followed

Reported by diabolo | April 6th, 2009 @ 12:23 PM

With a controller that redirects to request.referer and a referer url of http://path/products. Webrat now messes up the url that ends up being stored in @current_url.

This results in the code in

def internal_redirect?
  return false unless redirect?
  #should keep internal_redirects if the subdomain changes
  current_host_domain = current_host.split('.')[-2..-1].join('.') rescue current_host
  response_location_host_domain = response_location_host.split('.')[-2..-1].join('.') rescue response_location_host
  current_host_domain == response_location_host_domain


`current_host_domain` is correct as `www.example.com` but
`response_location_host_domain` is wrongly set as `www.example.comproduct`

I've spent considerable time debugging this, but cannot find where things are going wrong.

I know that when we get to

def request_page(url, http_method, data) #:nodoc:
  h = headers
  h['HTTP_REFERER'] = @current_url if @current_url

we are putting "products" into h, when we should be putting "/products". However I can't get further than this.

Comments and changes to this ticket

  • gaffo

    gaffo May 7th, 2009 @ 06:29 PM

    • Tag changed from bug, redirect to bug, redirect, verify
    • State changed from “new” to “open”

    Need to verify this. Any more controller, html or whatever code you can provide would help quite a bit to debug this.

  • gaffo

    gaffo June 15th, 2009 @ 12:19 AM

    • Tag changed from bug, redirect, verify to bug, redirect, stale, verify

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Ruby Acceptance Testing for Web applications.

Shared Ticket Bins

People watching this ticket