Fixed bug #66891 (Unexpected HTTP 401 after NTLM authentication)
authorMichael Wallner <mike@php.net>
Thu, 6 Nov 2014 15:22:18 +0000 (16:22 +0100)
committerMichael Wallner <mike@php.net>
Thu, 6 Nov 2014 15:22:18 +0000 (16:22 +0100)
commit5dfb7f296be471c20c21b3e39c00412e81706d78
tree8a8eec83e8c3752eeef818b72addb95025c2c1b8
parentacffb304a34e5e2a09c234f54179c34a0e8d3226
Fixed bug #66891 (Unexpected HTTP 401 after NTLM authentication)

If you set a "WWW-Authenticate" header PHP automatically issues a 401.

http\Env\Response slurps any set headers and re-sends it after sending
the status code, so that PHP might be resetting the status code to 401
because it sees again an WWW-Authenticate header.

Send the status code after any headers to avoid this issue.
package.xml
php_http_env_response.c
tests/bug66891.phpt [new file with mode: 0644]