PHP 4.0 Bug #8008 Updated: HTTP/1.1 307 Temporary Redirect ignored
| From: | jason@php.net | Date: | Wed, 29 Nov 2000 00:22:47 +0000 |
| Subject: | PHP 4.0 Bug #8008 Updated: HTTP/1.1 307 Temporary Redirect ignored | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-39432@lists.php.net to get a copy of this message | ||
ID: 8008
Updated by: jason
Reported By: leen@wirehub.nl
Status: Analyzed
Bug Type: HTTP related
Assigned To:
Comments:
Relassified back, CGI of course would work becuase it doesn't prune the HTTP header line as
done by most other webservers.
SAPI.c does reset response_code when it encounters Location
headers
A work around is to list the HTTP/1.1 xxx code header after the location header.
header ("Location: http://<redirlocation>");
header ("HTTP/1.1 307 Temporary Redirect");
I will be thinking about a possible better way to implement this
-Jason
Previous Comments:
---------------------------------------------------------------------------
[2000-11-28 18:20:49] jason@php.net
Reclassified and Verified on 4.0.3pl1 and CVS. Works fine in CGI mode does not work as apache
module.
-Jason
---------------------------------------------------------------------------
[2000-11-28 05:38:18] leen@wirehub.nl
in main/SAPI.c:
line code
441 SG(sapi_headers).send_default_content_type = 0;
442 } else if (!STRCASECMP(header_line, "Location")) {
443 SG(sapi_headers).http_response_code = 302; /* redirect */
444 } else if (!STRCASECMP(header_line, "WWW-Authenticate")) {
/* HTTP Authentication */
445 SG(sapi_headers).http_response_code = 401; /*
authentication-required */
446 }
447 *colon_offset = ':';
448 }
My knowledge of C is not so great but I can see that this is being ignored somewhere allong those
lines of code (this is part of my script):
header ("HTTP/1.1 307 Temporary Redirect");
header (""Location: "http://<redirlocation>");
Please do something about it, this is very anoying, because this is what I get:
HTTP/1.1 302 Found
Date: Tue, 28 Nov 2000 12:50:46 GMT
Server: Apache/1.3.9 (Unix) Debian/GNU PHP/4.0.3pl1
X-Powered-By: PHP/4.0.3pl1
Location: http://<redirlocation>
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html
(ofcourse http://<redirlocation> is then ofcourse a
real location)
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=8008