You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm writing a tool that leverages Mechanize (2.3 from RubyGems) with custom headers (such as authorization headers, cookies, etc). I discovered some issues when dealing with 302 redirects in certain circumstances that relate to the following.
When leveraging custom headers, cookies are not being set as received from the HTTP response.
Consider this working example:
require 'mechanize'
req = Mechanize.new.tap do |r|
r.set_proxy("localhost", 8080)
end
req.get "http://localhost:3000"
This examples loads localhost, which is running a rails-app. Upon loading that page it receives a 302 redirection, which it performs while overwriting the initial Rails session cookie, as it should.
Upon receiving the 302 redirect, it performs it, but the Rails session cookie is not being set. We're seeing the test cookie.
Is this a bug, or am I simply taking the wrong approach? The gist is that I need to be able to specify custom HTTP headers, including cookies, but follow the set-cookie response header as defined in the RFC.
The text was updated successfully, but these errors were encountered:
I'm sorry about the length of time that has passed without a reply. In an attempt to clean up the backlog of Mechanize issues, we're closing tickets that have had no recent activity.
If you'd like to re-open an issue to discuss, we'd be very thankful. Have a great day!
Hello,
I'm writing a tool that leverages Mechanize (2.3 from RubyGems) with custom headers (such as authorization headers, cookies, etc). I discovered some issues when dealing with 302 redirects in certain circumstances that relate to the following.
When leveraging custom headers, cookies are not being set as received from the HTTP response.
Consider this working example:
This examples loads localhost, which is running a rails-app. Upon loading that page it receives a 302 redirection, which it performs while overwriting the initial Rails session cookie, as it should.
Consider the next example:
Upon receiving the 302 redirect, it performs it, but the Rails session cookie is not being set. We're seeing the
test
cookie.Is this a bug, or am I simply taking the wrong approach? The gist is that I need to be able to specify custom HTTP headers, including cookies, but follow the
set-cookie
response header as defined in the RFC.The text was updated successfully, but these errors were encountered: