#32925 [Ver->Fbk]: HTTP Authentication is not carried through upon redirects.

From: Date: Thu, 14 Jul 2005 06:58:42 +0000
Subject: #32925 [Ver->Fbk]: HTTP Authentication is not carried through upon redirects.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-81841@lists.php.net to get a copy of this message
ID: 32925 Updated by: sniper@php.net Reported By: wb at pro-net dot co dot uk -Status: Verified +Status: Feedback Bug Type: HTTP related Operating System: FreeBSD PHP Version: 5.0.4 New Comment: Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip Previous Comments: ------------------------------------------------------------------------ [2005-05-03 13:21:40] wb at pro-net dot co dot uk Description: ------------ When using fopen() it seems that authentication details are not passed through upon a redirect and you will get a HTTP/1.1 401 Authorization Required. The server i am trying has a virtual host of the following... <VirtualHost 0.0.0.0:80> ServerName some.redirect.com RewriteEngine on RewriteRule ^/(.*) http://www.redirect.com/redirect/$1 [R,L] </VirtualHost> Which will just redirect the request to another location where authentication is needed. Reproduce code: --------------- <?php $fp = fopen('http://user:pass@some.redirect.com/', 'rb'); print_r($fp); ?> Expected result: ---------------- Resource id #2 Actual result: -------------- PHP Warning: fopen(): HTTP request failed! HTTP/1.1 401 Authorization Required ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=32925&edit=1

« previous php.bugs (#81841) next »