Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Reached end of document without finding <body> is an error, should be a warning or less #134

GoogleCodeExporter opened this issue Apr 6, 2015 · 5 comments


Copy link

What steps will reproduce the problem?

Generally, serve up an HTML output with no <body> tag in it

In my case: 

1. Run wordpress with wp-greetbox plugin
2. Notice the above error in the logs

What is the expected output? What do you see instead?

I didn't want to see these errors in the logs.

What version of the product are you using (please check X-Mod-Pagespeed

On what operating system?


Which version of Apache?

Apache/2.2.9 (Unix)

Which MPM?


Please provide any additional information below, especially a URL or an
HTML file that exhibits the problem.

mod_pagespeed reports HTML fragments with no <body> tag as an error, when in 
fact these are not really worth the attention of the server administrator.

For example, this WordPress plugin "WP-Greetbox" appears to be fetching the 
HTML fragment using AJAX and inserting it into the page, and in this case a 
body tag would be extraneous.

There are various other AJAX use cases for non-well-formatted HTML; for 
example, if you want to get plain text back in a POST response in an iframe 
I've found I have to send it as text/html otherwise browsers might wrap it in a 
<pre> tag or other wonderful transformations.  Sending the plain text with the 
wrong content type results in an innerHTML with just the right contents.

Original issue reported on by on 6 Dec 2010 at 6:45

Copy link

Also seeing this when loading the WordPress Dashboard, its AJAX responses also 
do not comtain a <body> tag it seems: 

[Sun Dec 05 22:45:49 2010] [error] [mod_pagespeed]
s:1: Reached end of document without finding <body>

Original comment by on 6 Dec 2010 at 6:47

Copy link

Fair enough.  Out of curiousity, is this an error page?  Or is WordPress 
generally not annotating its generated HTML with body tags?

Original comment by on 6 Dec 2010 at 3:17

Copy link

It's an HTML fragment:

<div class="greet_block"><div class="greet_text"><div class="greet_image"><a 
href="" rel="nofollow" 
s/google_icon.png" alt="WP Greet Box icon"/></a></div><div 
class="greet_block_close"><a id="greet_block_close" href="#">X</a></div>Welcome 
<strong>Googler</strong>! If you find this page useful, you might want to <a 
href="" rel="nofollow" 
dex.php/feed/rss/?referer=');"><strong>subscribe to the RSS feed</strong></a> 
for updates on this topic.<div style="clear:both"></div><div 
class="greet_block_powered_by">Powered by <a 
ugin/" title="WP Greet Box WordPress Plugin" 
-plugins/wp-greet-box-wordpress-plugin/?referer=');">WP Greet Box</a> <a 
href="" title="WordPress Plugin" 
Press Plugin</a></div></div></div><div style="clear:both"></div>

Original comment by on 6 Dec 2010 at 5:23

Copy link

Fixed in revision 294. Thank you for your report.

Original comment by on 6 Dec 2010 at 10:42

Copy link

Original comment by on 6 Dec 2010 at 10:43

  • Changed state: Fixed

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet

No branches or pull requests

1 participant