W3C home > Mailing lists > Public > public-swd-wg@w3.org > February 2009

Re: [Recipes] Puzzle with HTTP Accept, Firefox header plug-in and RDF

From: Diego Berrueta <diego.berrueta@fundacionctic.org>
Date: Fri, 13 Feb 2009 09:50:29 +0100
To: Antoine Isaac <aisaac@few.vu.nl>
Cc: SWD WG <public-swd-wg@w3.org>, sergio.fernandez@fundacionctic.org
Message-Id: <1234515029.6912.94.camel@duncan.lan>

Antoine,

El jue, 12-02-2009 a las 16:39 +0100, Antoine Isaac escribió:
> But when it queries for the SKOS 2008 file [3], Firefox gets redirected to [4] and not to [5].
> 
> How come? What is puzzling is that Vapour [6] reports that everything is ok with both URIs [1] and [3], even though the behaviours differ when there is no content negociation. Interestingly, Vapour itself recognizes my Accept headers: when I activate the application/rdf+xml only, it sends its reports in RDF, while it sends the HTML if I do nothing.
> 
> Is there something more than Accept header involved? Has my plug-in bugs, or am I just too dumb to think of myself playing with that kind of stuff?

This problem is a nice example of the risks of using the User-Agent
header for content negotiation. The server is issuing a redirect to the
HTML document when you use Firefox/IE, regardless of the content of the
Accept header. Compare these two requests:

$ curl -I -H "Accept: application/rdf+xml"
http://www.w3.org/2008/05/skos

HTTP/1.1 303 See Other
...
Location: http://www.w3.org/TR/2008/WD-skos-reference-20080829/skos.rdf
...


$ curl -I -H "Accept: application/rdf+xml" -H "User-agent: Mozilla/5.0
(X11; U; Linux i686; en-US; rv:1.9.0.6) Gecko/2009020409 Iceweasel/3.0.6
(Debian-3.0.6-1)" http://www.w3.org/2008/05/skos

HTTP/1.1 303 See Other
...
Location: http://www.w3.org/TR/2008/WD-skos-reference-20080829/skos.html
...


Best,

(Thanks to Sergio, in CC, for the HTTP traces)

-- 
Diego Berrueta
R&D Department  -  CTIC Foundation
E-mail: diego.berrueta@fundacionctic.org
Phone: +34 984 29 12 12
Parque Científico Tecnológico Gijón-Asturias-Spain
www.fundacionctic.org
Received on Friday, 13 February 2009 08:51:12 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 13 February 2009 08:51:12 GMT