New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Headers are not preserved on redirect #464
Comments
Maybe implement a follow_redirect! method instead of using the rack method? |
Maybe this is really a bug in rack-test... |
you're really not supposed to set headers this way. The Rack-Test driver has a headers option which you can use. Like this: Capybara.register_driver :rack_test do |app|
Capybara::RackTest::Driver.new(app, :headers => { 'Foo' => 'Bar' })
end however, that actually might have the same issue. Try it out and let me know how it goes. |
Ahh, never mind my comment, just understood why you're doing what you're doing. This does indeed appear to be a bug. |
Great stuff. Thanks very much. |
Here's a workaround for anyone waiting for the updated gem.
Disclaimer: This is not pretty. Since you will be visiting everything twice there might be some unintended side-effects. Use at your own risk, etc. |
I'm doing something like this to simulate an authenticated (kerberos) user:
It works fine unless I visit a url with a redirect. Then the header is lost and I'm no longer authed.
I wrote a failing test that illustrates the problem. See here:
simonbaird@cdc7ad7
I'm not sure how to fix this, but I'd give it a try given a small amount of encouragement...
Ps, anyone know a way to work around this issue?
The text was updated successfully, but these errors were encountered: