Testing in 1.3...
> It isn't a problem, 1.3 mime/negotation is subtely broken, so of course
> this works in 1.3.
>
> OK ... let's start from page one.
>
> Two files in a directory:
>
> index.html.en 1590 bytes
> index.html.fr 1632 bytes
>
> if the user's Accept-Language header is simply en, and they request
> index.html, they will get the .en variant.
Yep.
> Accept-Language of fr
> will return the french variant.
Yep.
> Accept-Language of anything else
> returns Not Acceptable,
Yep.
> and no Accept-Language will return the
> index.html.en variant if the LanguagePriority is set with en and fr
> both present and occuring in that order.
Yep.
>
> Now, Admin copies index.html.fr to index.html.temp. Starts editing,
> deletes two paragraphs...
>
> index.html.temp 1039 bytes
Done.
>
> User requests index.html with AcceptLanguage en or fr. They aught
> to get the right file.
Yep.
> User has another Accept-Language. They MAY
> get index.html.temp, because the others failed, and .temp inserts no
> no language identification to reject.
Set IE to request Basque [eu] and received 406 Not Acceptable which is correct.
> They provide no Accept-Language,
> and they _will_ get index.html.temp, based on size alone.
Nope, I don't get index.html.temp. I get index.html.en. In fact, if I attach a debugger
and watch what mod_negotiation is doing, it does not even allow index.html.temp to be
considered for negotiation because the content_type is NULL. Here is the code...
while ((dir_entry = readdir(dirp))) {
request_rec *sub_req;
/* Do we have a match? */
if (strncmp(dir_entry->d_name, filp, prefix_len)) {
continue;
}
if (dir_entry->d_name[prefix_len] != '.') {
continue;
}
/* Yep. See if it's something which we have access to, and
* which has a known type and encoding (as opposed to something
* which we'll be slapping default_type on later).
*/
sub_req = ap_sub_req_lookup_file(dir_entry->d_name, r);
/* If it has a handler, we'll pretend it's a CGI script,
* since that's a good indication of the sort of thing it
* might be doing.
*/
if (sub_req->handler && !sub_req->content_type) {
sub_req->content_type = CGI_MAGIC_TYPE;
}
/* HTTP_FORBIDDEN is returned, e.g., if the path length limit was exceeded */
/* HTTP_OK does NOT necessarily mean that the file is really readable! */
if (sub_req->status == HTTP_OK)
forbidden.all = 0;
else if (sub_req->status == HTTP_FORBIDDEN)
forbidden.any = 1;
if (sub_req->status != HTTP_OK || !sub_req->content_type) {
ap_destroy_sub_req(sub_req);
continue;
}
The sub_req for index.html.temp is destroyed because sub_req->content_type == NULL,
which
looks correct to me.
Bill