These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 4:13 pm Advanced search

W3C Validator does not send media type/mime headers

If you are stuck or have questions regarding HTML or other Web technologies, ask your questions here. No question too dumb!

W3C Validator does not send media type/mime headers

Postby JAB Creations » Sun Jan 17, 2010 10:25 am

As the title says the accept media type/mime is not set when the W3C (X)HTML validator contacts a URL. This prevents the validator from receiving XHTML pages as XHTML unless the media type/mime is hard-coded however few people would do this as it would block IE users. I'm not sure how to contact the W3C without begging for spammers to drop my email address in to their spam pools so if someone would be so kind as to pass the word I'd appreciate it! :)
User avatar
JAB Creations
<aside>
 
Posts: 566
Joined: Tue Mar 13, 2007 4:48 am
Location: Sarasota Florida, USA

Postby zcorpan » Fri Jan 22, 2010 10:56 am

http://validator.nu/ sends Accept and prefers XHTML, IIRC. It also changes its Accept header based on the parser selection in the UI.
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden

Postby valkyr » Thu Jan 28, 2010 8:00 am

You can set up rules in your scripting language of choice to send headers specifically for the validator. In PHP for example you could do

Code: Select all
if (stristr($_SERVER["HTTP_USER_AGENT"],"W3C_Validator"))
{
   header("Content-type: application/xhtml+xml");
}
valkyr
<h5>
 
Posts: 16
Joined: Sun Oct 18, 2009 1:30 am

Postby JAB Creations » Thu Jan 28, 2010 6:31 pm

valkyr wrote:You can set up rules in your scripting language of choice to send headers specifically for the validator. In PHP for example you could do

Code: Select all
if (stristr($_SERVER["HTTP_USER_AGENT"],"W3C_Validator"))
{
   header("Content-type: application/xhtml+xml");
}


I did that however it's no different then people who detect IE based on the user agent. :roll: It works though, I don't imagine many people spoof the validator. :lol:
User avatar
JAB Creations
<aside>
 
Posts: 566
Joined: Tue Mar 13, 2007 4:48 am
Location: Sarasota Florida, USA


Return to Help & Advice

Who is online

Users browsing this forum: No registered users and 1 guest