assaf/zombie — Issue #294: Redirect from .pressbutton document is "empty", browser obj appears to be from first posted page, not redirected page.
Author: bigattichouse
Created: 2012-03-02 19:11:31+00:00
State: open

I have some existing code that was working in older versions of zombie.

browser.pressButton("op", function(err, newbrowser, status) {
callback(newbrowser);
});

What appears to be happening:
1. called .pressbutton, which results in a POST to a redirector (URL A below)
2. zombie does all the redirections (URL B & C below)
3. the pressbutton function returns the browser object from the first call URL A, instead of from the final call URL C

1. browser in debug mode

A - Zombie: POST http://localhost/PSS/branches/DEV/MDD-1964/?destination=user/main
B - Zombie: POST /PSS/branches/DEV/MDD-1964/ => http://localhost/PSS/branches/DEV/MDD-1964/user/main
C - Zombie: GET http://localhost/PSS/branches/DEV/MDD-1964/user/main

2. dump of the browser object sent back , presumably with the /user/main URL:

Zombie: 0.12.15

URL: http://localhost/PSS/branches/DEV/MDD-1964/?destination=user/main
History:
1. http://localhost/PSS/branches/DEV/MDD-1964/
2: http://localhost/PSS/branches/DEV/MDD-1964/?destination=user/main

Cookies:
has_js=1; Domain=localhost; Path=/
SESS5bdd381815e0aa015e2eda0e2d3a6508=bdh-6SDizokuHGqvUf1X0w5lvfLsY76sOWm0FAaDlOI; Domain=localhost; Path=/; Max-Age=1999994994; HttpOnly

Storage:

Eventloop:
The time: Fri Mar 02 2012 12:59:38 GMT-0600 (CST)
Timers: 0
Processing: 1
Waiting: 0

Document: