You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Roy T. Fielding" <fi...@kiwi.ICS.UCI.EDU> on 1999/11/13 01:22:30 UTC

Re: default qualities in multi-line accept headers

In message <19...@w3.org>, Eric Prud'hommeaux writes:
>lynx sends multiple Accept headers like:
>
> Accept: text/html, text/plain, application/applefile, application/x-metamail-
>patch, sun-deskset-message, mail-file, default, postscript-file, audio-file, x
>-sun-attachment, text/enriched, text/richtext, application/andrew-inset, x-be2
> Accept: application/postscript, message/external-body, message/partial, appli
>cation/pgp, application/pgp, video/mpeg, video/*, image/*, audio/mod, text/sgm
>l, video/mpeg, image/jpeg, image/tiff, image/x-rgb, image/png, image/x-xbitmap
>, image/x-xbm
> Accept: image/gif, application/postscript, */*;q=0.01
>
>This means that text/html, text/plain and everything on the first
>line, as well as those on the second line, assume the default q of
>1.0.
>
>The CGI script gets all those headers mushed into a single
>$ENV{'HTTP_ACCEPT'} like:
>
> text/html, text/plain, application/applefile, application/x-metamail-patch, s
>un-deskset-message, mail-file, default, postscript-file, audio-file, x-sun-att
>achment, text/enriched, text/richtext, application/andrew-inset, x-be2, applic
>ation/postscript, message/external-body, message/partial, application/pgp, app
>lication/pgp, video/mpeg, video/*, image/*, audio/mod, text/sgml, video/mpeg, 
>image/jpeg, image/tiff, image/x-rgb, image/png, image/x-xbitmap, image/x-xbm, 
>image/gif, application/postscript, */*;q=0.01
>
>This is interpreted as everything is at q=0.01. 

No.  First, */* is an entry on its own -- it merely says that anything
not specifically mentioned on any Accept has q=0.01.  Everything else
has q=1 by default.  Second, it doesn't matter how the lines are split;
the interpretation is always the same, and the recipient will combine
them into one field in any case.

>Perhaps lynx is at fault for splitting lines that are not strictly
>concatonatable comma-separated lists. From rfc2616#4.2:

They are strictly concatenable.  I think you are just misreading what
*/* means.

....Roy

Re: default qualities in multi-line accept headers

Posted by Eric Prud'hommeaux <er...@w3.org>.
On Sat, Nov 13, 1999 at 05:38:52PM -0500, Eric Prud'hommeaux wrote:
> Oops - I've been misinterpreting the spec for a while now.
> Good think Henrik did all the header handling in libwww.
> thanks guys

Upon furthur inspection of earlier code - it appears I used to know
the proper interpretation and my ignorance is more alzheimer's-related.
I wonder if the "post the wrong answer" trick is a faster route to the
truth than doing a full cerebral context switch. ;-d  <-determined face
-- 
-eric

(eric@w3.org)

Re: default qualities in multi-line accept headers

Posted by Eric Prud'hommeaux <er...@w3.org>.
On Fri, Nov 12, 1999 at 04:52:01PM -0800, Greg Stein wrote:
> On Fri, 12 Nov 1999, Roy T. Fielding wrote:
> > In message <19...@w3.org>, Eric Prud'hommeaux writes:
> >...
> > > Accept: image/gif, application/postscript, */*;q=0.01
> > >
> > >This means that text/html, text/plain and everything on the first
> > >line, as well as those on the second line, assume the default q of
> > >1.0.
> >...
> > No.  First, */* is an entry on its own -- it merely says that anything
> > not specifically mentioned on any Accept has q=0.01.  Everything else
> > has q=1 by default.  Second, it doesn't matter how the lines are split;
> 
> To clarify: Roy is also saying that image/gif and application/postscript
> are *also* q=1.0.
> 
> In other words, the binding for ";q=0.01" is the specific MIME type, not
> the whole line.

Oops - I've been misinterpreting the spec for a while now.
Good think Henrik did all the header handling in libwww.
thanks guys
-- 
-eric

(eric@w3.org)

Re: default qualities in multi-line accept headers

Posted by Greg Stein <gs...@lyra.org>.
On Fri, 12 Nov 1999, Roy T. Fielding wrote:
> In message <19...@w3.org>, Eric Prud'hommeaux writes:
>...
> > Accept: image/gif, application/postscript, */*;q=0.01
> >
> >This means that text/html, text/plain and everything on the first
> >line, as well as those on the second line, assume the default q of
> >1.0.
>...
> No.  First, */* is an entry on its own -- it merely says that anything
> not specifically mentioned on any Accept has q=0.01.  Everything else
> has q=1 by default.  Second, it doesn't matter how the lines are split;

To clarify: Roy is also saying that image/gif and application/postscript
are *also* q=1.0.

In other words, the binding for ";q=0.01" is the specific MIME type, not
the whole line.

Cheers,
-g

--
Greg Stein, http://www.lyra.org/