Home » HTTP » HTTP_Request » Bug #3492
Redirect on Location doesn't work correctly with GET args
Details
| Submitted | 2005-02-16 16:05 UTC |
|---|---|
| From | aswl at calluk dot com |
| Status | Wont fix |
| Package | HTTP_Request |
| PHP Version | Irrelevant |
| OS | Irrelevant |
| Roadmaps | (Not assigned) |
Comments
[2005-02-16 16:05 UTC] aswl at calluk dot com
Description:
------------
When you issue a GET request with a querystring and it gets redirected to another location it appends the query string again even though it gets returned in the location header.
GET /test.aspx?xmldoc=test
Response Code: 302
[Server] => Microsoft-IIS/5.0
[X-Powered-By] => ASP.NET
[X-AspNet-Version] => 1.1.4322
[Location] => /(zdz0ty45blgf2oafdwkwlm55)/test.aspx?xmldoc=test
GET /(zdz0ty45blgf2oafdwkwlm55)/test.aspx?xmldoc=test&xmldoc=test
Response Code: 500
Reproduce code:
---------------
The following will reset the query string for an Absolute Path Redirect, may also affect other forms of redirect.
--- Request.php.orig 2005-02-16 15:27:10.679649521 +0000
+++ Request.php 2005-02-16 15:30:30.516653523 +0000
@@ -623,6 +623,7 @@
// Absolute path
} elseif ($redirect{0} == '/') {
$this->_url->path = $redirect;
+ $this->_url->querystring = array();
// Relative path
} elseif (substr($redirect, 0, 3) == '../' OR substr($redirect, 0, 2) == './') {
Expected result:
----------------
Response Code: 200
With the response body containing the XML result
Actual result:
--------------
The URL is set to the redirect Location header with the original querystring appended.