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

space between filter names in server header PageSpeedFilters forces server header PageSpeed: off to be ignored #979

Closed
GoogleCodeExporter opened this issue Apr 6, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1.  with php code at : http://127.0.0.1:8081/blank/test.php
<?php

header("PageSpeed: off");
header("PageSpeedFilters: -defer_javascript, -remove_comments");
echo "hello world\n";

?>

2. curl -v "http://127.0.0.1:8081/blank/test.php"


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

Expected pagespeed to be disabled for this request, and X-Mod-Pagespeed header 
should not be included in the resultant headers

the actual output is:

* Hostname was NOT found in DNS cache
*   Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 8081 (#0)
> GET /blank/test.php HTTP/1.1
> User-Agent: curl/7.35.0
> Host: 127.0.0.1:8081
> Accept: */*
> 
< HTTP/1.1 200 OK
< Date: Tue, 02 Sep 2014 22:14:11 GMT
* Server Apache/2.4.7 (Ubuntu) is not blacklisted
< Server: Apache/2.4.7 (Ubuntu)
< X-Powered-By: PHP/5.5.9-1ubuntu4.3
< PageSpeed: off
< PageSpeedFilters: -defer_javascript, -remove_comments
< Vary: Accept-Encoding
< X-Mod-Pagespeed: 1.8.31.4-4009
< Cache-Control: max-age=0, no-cache
< Connection: close
< Transfer-Encoding: chunked
< Content-Type: text/html
< 
hello world



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

1.8.31.4-4009

On what operating system?

Ubuntu 14.04.1 LTS

Which version of Apache?

Apache/2.4.7

Which MPM?

worker

URL of broken page:



Original issue reported on code.google.com by d...@ezoic.com on 2 Sep 2014 at 10:19

@GoogleCodeExporter
Copy link
Author

Hi -- seems reasonable to strip the whitespace before processing, so this is a 
valid bug report.

However, I just want to make sure you are aware that you can solve the problem 
by removing the excess spaces.

Original comment by jmara...@google.com on 3 Sep 2014 at 2:29

  • Changed state: Accepted
  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

Ya, working around it internally. Removing spaces, or removing the 
PageSpeedFilters altogether when PageSpeed: off is set. Go's default behavior 
for handling multiple values for the same http header is to join with comma and 
spaces, causing headaches to handle the special case. 

Original comment by d...@ezoic.com on 3 Sep 2014 at 2:50

@GoogleCodeExporter
Copy link
Author

This issue was closed by revision r4339.

Original comment by jefftk@google.com on 6 Nov 2014 at 3:12

  • Changed state: Fixed

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

No branches or pull requests

1 participant