Re: PHP 4.0 Bug #8552 Updated: fopen doesn't open URL
| From: | Cynic | Date: | Fri, 05 Jan 2001 20:09:20 +0000 |
| Subject: | Re: PHP 4.0 Bug #8552 Updated: fopen doesn't open URL | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-43081@lists.php.net to get a copy of this message | ||
This still doesn't answer my concern about status code 300.
Excerpt from RFC 2616:
10.3.1 300 Multiple Choices
The requested resource corresponds to any one of a set of
representations, each with its own specific location, and
agent-driven negotiation information (section 12) is being
provided so that the user (or user agent) can select a
preferred representation and redirect its request to that
location. Unless it was a HEAD request, the response SHOULD
include an entity containing a list of resource characteristics
and location(s) from which the user or user agent can choose
the one most appropriate. The entity format is specified by the
media type given in the Content- Type header field. Depending
upon the format and the capabilities the user agent, selection
of the most appropriate choice MAY be performed automatically.
However, this specification does not define any standard for
such automatic selection. If the server has a preferred choice
of representation, it SHOULD include the specific URI for that
representation in the Location field; user agents MAY use the
Location field value for automatic redirection. This response
is cacheable unless indicated otherwise.
At 20:51 5.1. 2001, Stig Venaas wrote the following:
--------------------------------------------------------------
>On Fri, Jan 05, 2001 at 07:05:25PM +0100, Cynic wrote:
>> At 18:30 5.1. 2001, Zak Greant wrote the following:
>> > Perhaps it would be good to throw a notice level error when handling
>> > redirects - redirects are often put into place when a resource has
>> > moved. If PHP handles them perfectly transparently, then the site
>> > admin may not know that a resource has moved til the redirect is
>> > removed.
>> >
>> > --zak
>> ------end of quote------
>>
>> In that case, I would like the notice mechanism be done so
>> that it's easy to get the server response code... BTW, what
>> would happen if server returned 300 (Multiple Choices)?
>
>The way it is now, a script could check the contents of
>$http_response_header and do a redirect on it's own, it would be
>easier for the user, and the right thing in most cases, to follow the
>redirect I think. I agree that one should be able to see the response
>code. It seems reasonable that $http_response_header is the header for
>the final location, but we could in theory also put the header of the
>first location (possible several with a chain of redirects) in there.
>I'm not sure.
>
>Might be nice if one could specify if one want to follow redirects or not,
>but I don't really see a nice way to specify it. One could have some extra
>code in the mode string which seems bad, or we could say that the optional
>include_path parameter denotes whether to follow redirects since
>include_path doesn't make sense for HTTP URLs anyway. If we do this, I
>still think we should follow by default which also seems to be the
>behavior in PHP3 and up to 4.0.2.
>
>Stig
------end of quote------
____________________________________________________________
Cynic:
A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.
cynic@mail.cz