#23602 [Bgs->Opn]: Can't Force HTTP/1.0 Over HTTP/1.1
| From: | hans at nyu dot edu | Date: | Mon, 19 May 2003 15:05:16 +0000 |
| Subject: | #23602 [Bgs->Opn]: Can't Force HTTP/1.0 Over HTTP/1.1 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-39975@lists.php.net to get a copy of this message | ||
ID: 23602
User updated by: hans at nyu dot edu
Reported By: hans at nyu dot edu
-Status: Bogus
+Status: Open
Bug Type: HTTP related
Operating System: FreeBSD 4.7
PHP Version: 4.3.2RC2
New Comment:
I believe this is a bug in PHP, or at least in how it writes headers
through SAPI.c, and is not related to RFC2616 Upgrade/Switch behavior
(http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.42).
I believe this problem is at:
http://lxr.php.net/source/php4/main/SAPI.c#542
With a call such as header('HTTP/1.0 409'); the HTTP version is never
even considered. The status code is the only thing that is examined
and changed.
And, in fact, I'm unsure why PHP/Apache would respond with a HTTP/1.1
header when given a HTTP/1.0 request. Telnetting to port 80 of my
PHP/4.3.2RC2 server and issuing the following request:
GET /test.php HTTP/1.0
Host: test.com
will illicit a HTTP/1.1 response, even when test.php contains:
header('HTTP/1.0 409');
or:
header('101',TRUE,101);
header('Upgrade: HTTP/1.0');
as noted as the way to "Switch" protocols in the RFC, albeit in this
case, since the client is me doing a telnet and not a user agent, this
would have little bearing.
If someone could take another look at this I'd very much appreciate
it.
Hans
Previous Comments:
------------------------------------------------------------------------
[2003-05-13 01:42:09] helly@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
You need to "SWITCH" the protocol.
------------------------------------------------------------------------
[2003-05-12 18:58:41] hans at nyu dot edu
I have a .php setup as an ErrorDocument under Apache 1.3.27, compiled
as a DSO. When an request is made that isn't found, the page is called
without issue. So, I'm trying to set a different header, for example:
header('HTTP/1.0 408 Request Time-out',TRUE,408);
However, the response header always ends up:
HTTP/1.1 408 Request Time-out
on the client. If I were to change the status code, everything works
as expected, yet I can't override the HTTP version.
Is this expected behavior; do I need to force changes like this in
Apache's conf, or is it something that could use another look?
Many thanks,
Hans
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23602&edit=1