httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexei Kosut <>
Subject Re: 406 responses, variant list
Date Mon, 06 Jan 1997 04:37:03 GMT
On Sun, 5 Jan 1997, Brian Behlendorf wrote:

> So, the problem is, I want to get a list of the possible variants instead of
> having to hunt for them on my own.  I could have sworn that at one point Rob
> Hartill posted a patch which put the possible variants in a 406 response into a
> CGI environment variable, which then allowed an ErrorDocument 406 CGI script to
> use that to format the output. Since it appears that 406 responses from
> are very prettily outputted, I presume he was doing something like
> this, yet I can't find it in the apache code anywhere.  I do see
> make_variant_list in mod_negotiation.c, which puts a really simple HTML list of
> the variants in the "variants-list"  note, but it doesn't appear to actually
> work.  Try doing a 
>   telnet 80
>   GET / HTTP/1.0
>   Accept: image/gif
> and you'll see what I mean.  The code looks like it might have been an
> ommission in the case switch in http_protocol.c for NOT_ACCEPTIBLE (notice
> that the one below it, MULTIPLE_CHOICES, appears to try and output the
> "variant-list" note), yet it doesn't work for MULTIPLE_CHOICES either.

This has to do with the way mod_dir works. Use /index and it will work
as advertised. (you'll also see why AddHandler is a better idea than
AddType for includes, but that's a different story).

The problem is that if you have "DirectoryIndex index welcome", say,
and there exists some variants of index that are not acceptable, but
there is an acceptable variant of welcome, you'd want the acceptable
variant of welcome. So the code (if you recall, we added this just
recently) looks at each variant, and stores the response code (unless
sucessful) - in this case, the 406. But any other information gets

Now, the other approach would be if the first directoy index is not a
404, just return it, regardless of the others. This would result in
more correct behavior, HTTP-wise (esp in the case you mention here),
but would not allow additional DirectoryIndex entries to be

Alexei Kosut <>      The Apache HTTP Server

View raw message