PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTTP » HTTP_Request » Bug #46

Buggy Posting Data with Redirects

Details

Submitted2003-09-29 20:04 UTC
Fromnoels01 at gmx dot net
StatusWont fix
PackageHTTP_Request
PHP Version4.3.1
OSWin32
Roadmaps(Not assigned)

Comments

[2003-09-29 20:04 UTC] noels01 at gmx dot net

Description:
------------
I'm using HTTP_Request to post data to dynamic webpage. The data is processed and a HTTP header with response code 302 is sent.

The intention is to redirect the user to anther page, after submitting the data. Submitting works fine, but HTTP_Request always resends the same headers as before, so the page thinks that it is the first time submitting the data and resends a 302 and so on and so on. The request is caught in a recursion and fails after some tries. The class should not send the posted data again, after being redirected.
A bug! No existing browser resends the data after being redirected...

Reproduce code:
---------------
A little change in HTTP_Request::sendRequest() should fix the bug:

Add a single line before increasing the variable...

$this->clearPostData();
$this->_redirects++;
return $this->sendRequest();