note 24702 added to function.fopen
| From: | php-general at lists dot php dot net | Date: | Mon, 26 Aug 2002 11:14:15 +0000 |
| Subject: | note 24702 added to function.fopen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-35658@lists.php.net to get a copy of this message | ||
Note that the WebGetObject class above does not parse HTTP headers correctly:
- it should detect headers split in multiple lines (they are continued by starting the next line by
an additional space or tab),
- it does not handle correctly the slitting between the header name and its value (it requires no
space before the colon, and requires one space after it, where HTTP allows no space or additional
whitespace): it should split in two parts only lines that contain a ":" character and trim
both splitted parts.
- it does not parse header values according to the HTTP format regarding blanks, comma and
(comments)
- it does not support headers that may be repeated (and that should be returned either as an array
value for the header name stored in the returned key, or by merging headers with a separating
comma), so it looses some headers.
Regarding the problem with the "proxying" script, it simply does not work because the HTTP
transaction is not complete: it should emit the "Host:" header that most proxies require
to specify the proxy host name, even when performing an HTTP/1.0 GET request. This is because most
proxies are configured to allow virtual hosts including themselves.
--
http://www.php.net/manual/en/function.fopen.php
http://master.php.net/manage/user-notes.php?action=edit+24702
http://master.php.net/manage/user-notes.php?action=delete+24702
http://master.php.net/manage/user-notes.php?action=reject+24702