Re: PHP 4.0 Bug #8552 Updated: fopen doesn't open URL
| From: | Stig Venaas | Date: | Fri, 05 Jan 2001 20:28:56 +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-43082@lists.php.net to get a copy of this message | ||
On Fri, Jan 05, 2001 at 09:09:20PM +0100, Cynic wrote:
> This still doesn't answer my concern about status code 300.
Right
> 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.
Without a way of knowing which, I would just pick one, perhaps always
the first? Only way we might have a clue is if the mode parameter
includes b for binary perhaps. I would like to keep it simple, so I
think better not.
> 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.
In this case we should pick the preferred one.
If we add an option for whether to follow redirects, a script that cares
about picking the right choice (using criteria of it's own) should turn
redirect following off, and parse $http_response_header and do it on
their own.
I think that whatever we do it will have to be a compromise when using
fopen(), it will be hard to make fopen() suit all needs.
Personally I think it makes sense to follow redirects by default, but
I don't care that much what we do, and I'm open to suggestions. I think
we should together look at the pros and cons and try to figure what's
best.
Stig