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

Mod PageSpeed 0.10.21.2-1381 fails to retrieve combined objects with error, "Invalid escaped URL segment" #380

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

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Upload the attached HTML document (pagespeed_test.html) to a pagespeed 
enabled server
2. Enable the PageSpeed filter combine_javascript
3. Create two bogus javascript files, /example_1.js and /example_2.js at the 
web document root. The contents of these files does not matter.
4. Access http://servername/pagespeed_test.html twice.

What is the expected output? What do you see instead?
Expected Behavior: The combined JavaScript file should be created and 
accessible by pagespeed.

Actual Behavior: PagSpeed combines the JavaScript files, but the combined file 
is inaccessible.  The HTTP response code is 404 when the browser makes the 
below request: 
http://servername/example_1.js+example_2.js.pagespeed.jc.ZKzOolut-6.js

The following error is present in the appache error log:
[Thu Feb 09 11:19:26 2012] [error] [mod_pagespeed 0.10.21.2-1381 @2121] Invalid 
escaped URL segment: example_1.js%2bexample_2.js

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

On what operating system?
# cat /etc/SuSE-release
openSUSE 11.4 (x86_64)
VERSION = 11.4
CODENAME = Celadon

# uname -a
Linux linux-ghzy 2.6.37.6-0.7-desktop #1 SMP PREEMPT 2011-07-21 02:17:24 +0200 
x86_64 x86_64 x86_64 GNU/Linux

Which version of Apache?
Apache/2.2.17 (Linux/SUSE)

Which MPM?
prefork

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

We are running the mod_pagespeed engine on Apache as a reverse-proxy to our web 
servers.

We did not see this issue in the previously released version: 0.10.19.5-1253

We see the same error when mod_pagespeed combines CSS files, however we had 
more difficulty reproducing this issue with CSS imports.

The issue may be unique to our environment.  We would be glad to provide more 
details if required.

Original issue reported on code.google.com by ericache...@gmail.com on 9 Feb 2012 at 5:07

Attachments:

@GoogleCodeExporter
Copy link
Author

Looks like we may need to decode "%2b" -> "+" somewhere.

Original comment by sligocki@google.com on 9 Feb 2012 at 6:36

@GoogleCodeExporter
Copy link
Author

I tried your HTML/js on my stock install of 0.10.21.2 and it worked correctly, 
no error messages.

Could you please provide your pagespeed.conf, edited to obfuscate as necessary?

Original comment by matterb...@google.com on 9 Feb 2012 at 6:38

@GoogleCodeExporter
Copy link
Author

Another data point. The URL my Apache generated was:
example_1.js,Mjm.Z6qxY897US.js+example_2.js,Mjm.dF9uKW21_i.js.pagespeed.jc.grMhQ
Y8bUC.js
which means both JS were rewritten (JS minified) then combined.
The reported URL is combined only.

Original comment by matterb...@google.com on 9 Feb 2012 at 6:52

@GoogleCodeExporter
Copy link
Author

Also, what browser are you using? It could be that some browsers are deciding 
to escape "+" -> "%2b"

Original comment by sligocki@google.com on 9 Feb 2012 at 8:04

@GoogleCodeExporter
Copy link
Author

I believe I have located the source of issue.  The + is being translated to a 
"%2b" by a proxy server.

We are using Oracle iPlanet web server to reverse-proxy requests to the Apache 
mod_pagespeed service.  The proxy server is encoding the + (as requested by the 
browser) to "%2b".

When the browser requests content directly from the apache server it is 
retrieved successfully.

Interestingly this setup worked fine with the previous version of mod_pagespeed 
(i.e. pagespeed was able to decode/translate the encoded URL to the combined 
file).

I can gladly provide the pagespeed.conf file if you feel it would provide value 
to this case, but I believe this should be enough information to determine how 
you would like to proceed.

Thank you,

Eric


Original comment by ericache...@gmail.com on 9 Feb 2012 at 8:27

@GoogleCodeExporter
Copy link
Author

No, you've found the problem. I know we changed encoding rules recently so we 
will start looking there.
Other than disabling combining, do you have a work-around?

Original comment by matterb...@google.com on 9 Feb 2012 at 8:56

@GoogleCodeExporter
Copy link
Author

Our current work-around is to revert to mod_pagespeed version 0.10.19.5.

Original comment by ericache...@gmail.com on 9 Feb 2012 at 9:19

@GoogleCodeExporter
Copy link
Author

Jan has fixed this bug and it is available now in trunk, and will be released 
soon.

Original comment by jmara...@google.com on 10 May 2012 at 7:54

  • Changed state: Fixed
  • Added labels: release-note

@GoogleCodeExporter
Copy link
Author

Original comment by jmara...@google.com on 22 May 2012 at 7:24

  • Added labels: Milestone-v22

@GoogleCodeExporter
Copy link
Author

I have confirmed the fix in the binary release 0.10.22.4.

Thank you,

Eric Achelis

Original comment by ericache...@gmail.com on 1 Jun 2012 at 9:18

@GoogleCodeExporter
Copy link
Author

Thanks for double-checking the fix, Eric.  Marking as Verified.

Original comment by jmaes...@google.com on 4 Jun 2012 at 2:22

  • Changed state: Verified

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