You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.
In various places in the code we make XHTML vs HTML decisions based on doctype.
We should instead be using mimetype.
Example:
http://code.google.com/p/modpagespeed/source/browse/trunk/src/net/instaweb/rewri
ter/javascript_filter.cc#240
Original issue reported on code.google.com by jmara...@google.com on 20 May 2012 at 1:36
The text was updated successfully, but these errors were encountered:
Thoughts on this: the challenge here is that in Apache we are not guaranteed
to have the final word on the mimetype when mod_pagespeed runs.
See also Issue 422. Both these issues are most easily resolved if
mod_pagepseed can run late; after any filter that may modify content-type,
notably mod_headers.
The issue right now is that currently we are making a decision based on the
DOCTYPE, which is not really accurate, however, at least we know exactly what
the DOCTYPE is in mod_pagespeed, since most other filters don't modify content.
So this bug addresses only when the DOCTYPE is wrong. However, if we fix it,
then we may make the situation worse because we might make xhtml-or-not
decisions that might be changed later, downstream of our filter.
One thought, however, is to register another output handler (actually we
already have one: instaweb_fix_headers_filter) which could at least *detect* a
problem by seeing whether the content-type it sees is the same as the
content-type we saw in instaweb_out_filter.
What I haven't figured out is what we should do if we detect a problem. Use
the property-cache to remember the eventual content type for an HTML file,
overriding the value we see in request->content_type?
Original comment by jmara...@google.com on 8 Jun 2012 at 10:30
Original issue reported on code.google.com by
jmara...@google.com
on 20 May 2012 at 1:36The text was updated successfully, but these errors were encountered: