httpd diff (fixes single instance of XHTML-style element)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

httpd diff (fixes single instance of XHTML-style element)

Andras Farkas
Hello!
Today I noticed, when looking at an autoindex page on my own website,
that despite the page being HTML (as evidenced by <hr> being used
rather than <hr/> further down, and also by the page being served as
text/html) there was a single instance of an XHTML-style element:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
Notice the second to last character, the slash.  This makes the META
element here invalid HTML.
This simple attached patch fixes this.
Thanks. :D

httpddiff.txt (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: httpd diff (fixes single instance of XHTML-style element)

Anthony J. Bentley-4
Hi Andras,

Andras Farkas writes:
> Today I noticed, when looking at an autoindex page on my own website,
> that despite the page being HTML (as evidenced by <hr> being used
> rather than <hr/> further down, and also by the page being served as
> text/html) there was a single instance of an XHTML-style element:
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
> Notice the second to last character, the slash.  This makes the META
> element here invalid HTML.

This is not actually invalid HTML these days. The HTML5 spec allows
closing slash in <meta>, even when served with a non-XML MIME type,
and simply ignores the slash.

However, it's probably worthwhile to use the modern idiom here, which is
<meta charset="utf-8">

--
Anthony J. Bentley