This project is archived and is in readonly mode.
integration.rb follow_redirect! forgets HTTP_AUTH
Reported by Enrico Teotti | August 20th, 2008 @ 08:58 AM | in 2.x
In integration.rb the follow_redirect! method uses:
get(interpret_uri(headers['location'].first))
and it doesn't remember the HTTP_AUTHORIZATION coming from the previous request. I guess it's normal not to as a browser cache does but it's still a problem during testing. I solved it changing the call to:
get(interpret_uri(headers['location'].first), nil, {:authorization => @request.headers["HTTP_AUTHORIZATION"]})
I've attached the dummy project where I did the test: integration/products_test.rb I had No idea how to create an automated test to test the test :) Hope it will help to knock out this small issue.
Cheers
Comments and changes to this ticket
-
josh August 27th, 2008 @ 02:11 AM
- State changed from new to wontfix
Exactly, your browser resends that data everytime. It would be nice to be able to set the default headers for each request.
Not exactly an easy fix thought ;)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>