Re: [Suggestion] Wrong environment variable specified when validating ($_SERVER['http-accept])

Hi David!

Am 02.11.2007 um 04:57 schrieb David Coll:

> The exemple of what I'm discussing can be seen here : http:// 
> tecfa.unige.ch/perso/maltt/davidco0/
>
> When declaring the Mime-type of a document as " application/xhtml 
> +xml ", IE7 will ask you if he must save the document or else..  
> Well, he is just NOT recognising this mime-type as a web document..  
> You're probably aware of that..
>
> So the solution I've found was to use the PHP environment variable  
> $_SERVER['http-accept] to determine wheter or not my pages should  
> be declared variable " application/xhtml+xml " or "text/html".  
> Indeed, this variable specify in Opera and Firefox if the value "  
> application/xhtml+xml ", which IE does not.
>
> Your validator is displaying a warning concerning the mime-type  
> because it is not sending that request.
>
> The suggestion is simply to add it in your request headers ^_^

Your issue is a long addressed and much controversely discussed issue  
on the www-validator list.

Please read carefully the following Validator Bug #785 and Bug #848  
and their comments.

validator does not supply reasonable Accept header by default
http://www.w3.org/Bugs/Public/show_bug.cgi?id=785

Content Negotiation (or MIME Types)
http://www.w3.org/Bugs/Public/show_bug.cgi?id=848


Your problem, might be solved hopefully in the near future, but a  
patch closing that issue still isn't around the corner, mainly due to  
controversal views concerning that topic.

As a granted not optimal interim solution, http://validator.w3.org/ 
docs/users.html#Options might satisfy your needs a little bit sind  
version 0.8.2, the recent validator release:

"For Content-Negotiated resources, set a specific Accept Header (accept)
     This option (experimental, as of 0.8.2) is useful if your Web  
server is set up to use format negotiation, serving different content  
based on the preferred/accepted media types of the user-agent. The  
validator can then emulate different HTTP Accept behaviors.
     For example, append "accept=application%2Fxhtml%2Bxml%2C*" and  
the validator will send the HTTP Header "Accept: application/xhtml 
+xml,*".

Sierk Bornemann
-- 
Sierk Bornemann
email:            sierkb@gmx.de
WWW:              http://sierkbornemann.de/

Received on Monday, 5 November 2007 17:53:07 UTC