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
What it does at the moment is to retain basically all data from the original request, except the path, which it overrides. This means that if you for instance make a POST request to a URL, and that URL redirects to another page, the second request will be the same. This is a violation of HTTP/1.1 for the 303 status code (which demands a GET request for the new location), and – worse – inconsistent with how all browsers I know of handle 302 and possibly 301.
Thus, my proposal would be a diff of the following nature:
You're spot-on about the need to use GET and exclude the params. The headers should be fine—indeed, necessary—as they're only used internally to specify the Referer.
capybara.werkzeug.browser.Browser._process_and_follow_redirects handles redirects in what I would consider a wrong way. I'm talking specifically about
capybara.py/capybara/werkzeug/browser.py
Line 61 in 566b136
What it does at the moment is to retain basically all data from the original request, except the path, which it overrides. This means that if you for instance make a POST request to a URL, and that URL redirects to another page, the second request will be the same. This is a violation of HTTP/1.1 for the 303 status code (which demands a
GET
request for the new location), and – worse – inconsistent with how all browsers I know of handle 302 and possibly 301.Thus, my proposal would be a diff of the following nature:
Whatever
params
would be needed for the subsequent request would be indicated in the response'sLocation
header.I am unsure whether
headers
should be retained in its entirety, but I don't know what would be consistent with browser behaviour.The text was updated successfully, but these errors were encountered: