ID:               23902
 Updated by:       [EMAIL PROTECTED]
 Reported By:      noxter at web dot de
 Status:           Assigned
 Bug Type:         CGI related
 Operating System: Windows 2000
 PHP Version:      4.3.2
 Assigned To:      shane
 New Comment:

Yeah, I started on a fix for it yesterday and will look at it again
tonight.  Not sure who wrote the header stuff, but not checking for
NULL is the problem here.


Previous Comments:
------------------------------------------------------------------------

[2003-06-02 12:42:46] [EMAIL PROTECTED]

This works:

<?php
     
    header("WWW-Authenticate: Basic realm=\"example\"");
    header("HTTP/1.0 401 Authorization Required");      

?>

For Shane:
Seems that when line sapi/cgi/cgi_main.c:307 is reached,
the SG(sapi_headers).http_status_line is reset to NULL in line
main/SAPI.c:591 (matters only when cgi.rfc2616_headers = 1).

Not sure if this is bug in SAPI.c (or not even a bug) but
CGI SAPI should handle this a bit better, at least by not setting that
"(null)\r\n" header line.


------------------------------------------------------------------------

[2003-06-02 11:43:14] noxter at web dot de

No difference. HTTP/1.0 or 1.1, the result is alike.

------------------------------------------------------------------------

[2003-06-01 21:01:55] [EMAIL PROTECTED]

What if you sent it as HTTP/1.1:

header("HTTP/1.1 401 Authorization Required");

Does it make any difference?


------------------------------------------------------------------------

[2003-05-30 12:16:33] noxter at web dot de

The follow example failed by php as common gateway interface
application. This problem is common and not specified of a server.
Testing with apache, iis, devwex ... .  The option cgi.rfc2616_headers
= 1 is setting in the php.ini.

<?
    header("HTTP/1.0 401 Authorization Required");
    header("WWW-Authenticate: Basic realm=\"example\"");
?>

the response of Server :

    HTTP/1.1 200 OK
    Server: Microsoft-IIS/5.0
    Date: Fri, 30 May 2003 17:04:01 GMT
    (null)
    Content-type: text/html
    X-Powered-By: PHP/4.3.2
    WWW-Authenticate: Basic realm="example"

the respone of CGI:

    (null)
    Content-type: text/html
    X-Powered-By: PHP/4.3.2
    WWW-Authenticate: Basic realm="example"
    ...

the respone correct is:

    HTTP/1.0 401 Authorization Required
    Content-type: text/html
    X-Powered-By: PHP/4.3.2
    WWW-Authenticate: Basic realm="example"
    ...



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=23902&edit=1

Reply via email to