Wednesday, 18 September 2013

How to change accept header at google chrome?

How to change accept header at google chrome?

I want to see an error which will happen if I send not valid(according to
XHTML standard) markup to browser. I'm using google chrome as browser,
apache as server and php as script language. I've created a script with
such lines:
header('Content-type: application/xhtml+xml');
$content = <<< XHTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml;
charset=utf-8" />
<title>XHTML</title>
</head>
<BODY>
<P>Lorem ipsum dolor sit amet...</P>
</BODY>
</html>
XHTML;
echo $content;
It should be incorrect because of BODY from capital letters. But I'm
getting correct results, because I see that google chrome accept such
mime-types:
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
So it interprets result as text/html and everything is fine.
I want to make this document invalid. How I can remove text/html from
accepted headers at google chrome? Or I am wrong at something?

No comments:

Post a Comment