#32925 [NEW]: HTTP Authentication is not carried through upon redirects.
| From: | wb at pro-net dot co dot uk | Date: | Tue, 03 May 2005 11:21:41 +0000 |
| Subject: | #32925 [NEW]: HTTP Authentication is not carried through upon redirects. | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-78593@lists.php.net to get a copy of this message | ||
From: wb at pro-net dot co dot uk
Operating system: FreeBSD
PHP version: 5.0.4
PHP Bug Type: HTTP related
Bug description: HTTP Authentication is not carried through upon redirects.
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 bug report at http://bugs.php.net/?id=32925&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32925&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32925&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32925&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=32925&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=32925&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=32925&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=32925&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=32925&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32925&r=support
Expected behavior: http://bugs.php.net/fix.php?id=32925&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=32925&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=32925&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=32925&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32925&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=32925&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=32925&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32925&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=32925&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=32925&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=32925&r=mysqlcfg