Skip to content
This repository was archived by the owner on Apr 10, 2025. It is now read-only.
This repository was archived by the owner on Apr 10, 2025. It is now read-only.

ModPagespeedLoadFromFile doesn't set the Content-Type correctly when query params exist #405

@GoogleCodeExporter

Description

@GoogleCodeExporter
In r1231 (ref issue 357), ModPagespeedLoadFromFile started stripping query 
params from the resource name before loading it. However, it seems that the 
query string params are still affecting the output in that they aren't stripped 
before determining the content type of certain resources. I'm seeing a lot of 
these in my log:


[Thu Mar 29 13:45:03 2012] [error] [mod_pagespeed 0.10.21.2-1381 @6876] Loaded 
resource with no Content-Type 
http://mysite.com/wp-includes/js/thickbox/thickbox.css?ver=20111117


It causes problems because that rewritten stylesheet is then served with a 
text/plain Content-Type header, effectively rendering it useless the first time 
it's served. Subsequent requests to that same resource load the mod_pagespeed- 
processed and cached resource, which then has the correct content type. 
Removing the ModPagespeedLoadFromFile directive and making mod_pagespeed fetch 
the file over HTTP resolves that issue.

The fix is to strip query params from the file name before determining the 
content type that's served for the not-yet-processed resource in the initial 
hit.

Original issue reported on code.google.com by amat...@gmail.com on 29 Mar 2012 at 8:54

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions