From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jason Rumney Newsgroups: gmane.emacs.devel Subject: Re: Do you understand this? Date: Sun, 06 Mar 2005 23:05:29 +0000 Message-ID: References: <87sm38jyhm.fsf@tapsellferrier.co.uk> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1110150282 21653 80.91.229.2 (6 Mar 2005 23:04:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 6 Mar 2005 23:04:42 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 07 00:04:41 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1D84na-00058n-Jd for ged-emacs-devel@m.gmane.org; Mon, 07 Mar 2005 00:04:35 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D857E-0007cL-Tm for ged-emacs-devel@m.gmane.org; Sun, 06 Mar 2005 18:24:52 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1D856P-0007SV-Lh for emacs-devel@gnu.org; Sun, 06 Mar 2005 18:24:01 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1D856H-0007NH-4p for emacs-devel@gnu.org; Sun, 06 Mar 2005 18:23:56 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D856F-0007MH-Kr for emacs-devel@gnu.org; Sun, 06 Mar 2005 18:23:51 -0500 Original-Received: from [194.106.33.237] (helo=outmail.freedom2surf.net) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1D84og-0005Rd-Mw for emacs-devel@gnu.org; Sun, 06 Mar 2005 18:05:43 -0500 Original-Received: from wanchan.jasonrumney.net (i-195-137-77-250.freedom2surf.net [195.137.77.250]) by outmail.freedom2surf.net (8.12.10/8.12.10) with ESMTP id j26N5fnF010584; Sun, 6 Mar 2005 23:05:41 GMT Original-Received: from TONKOTSU-RAMEN (tonkotsu-ramen.jasonrumney.net [10.0.0.28]) by wanchan.jasonrumney.net (Postfix) with ESMTP id 0028EDDFDF; Sun, 6 Mar 2005 23:05:40 +0000 (GMT) Original-To: bob@rattlesnake.com In-Reply-To: (Robert J. Chassell's message of "Sun, 6 Mar 2005 22:32:56 +0000 (UTC)") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (windows-nt) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org X-MailScanner-To: ged-emacs-devel@m.gmane.org Xref: news.gmane.org gmane.emacs.devel:34257 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:34257 "Robert J. Chassell" writes: > Accept: text/plain; > q=0.5, text/html, text/x-dvi; > q=0.8, text/x-c > > If sent in an HTTP request for a resource /fred the above Accept > headers tells the server that the user will ideally accept /fred as an > HTML document or a text/x-c document. > > I do not understand. > > Am I right in formatting the statement such that semi-colons have a > higher precedence than commas? Somewhat unintuitively in HTTP headers their precedence is reversed from what you might expect in English text. Commas seperate header values and are shorthand for multiple headers, so the above could be rewritten more clearly as: Accept: text/plain; q=0.5 Accept: text/html Accept: text/x-dvi; q=0.8 Accept: text/x-c Also q defaults to 1.0 if not explicitly stated, so text/x-c and text/html have highest priority. > An alternative formatting is that semi-colons precede q settings, and > that if a format lacks a q setting, it has the highest priority. Basically right, but your reformatting suggests that you may be thinking that text/html inherits the q=0.8, which is not correct. > > Thus, the above could be formatted like this > > Accept: text/plain; q=0.5, > text/html, text/x-dvi; q=0.8, > text/x-c There is also an Accept-Charset header with the same rules, which fits the original manual description slightly better.