Fix: ngx_pagespeed encloses url in noscript refresh with '

Bug reports and enhancement requests
Post Reply
guradia
Posts: 1
Joined: Tue Dec 12, 2017 12:09 am

Fix: ngx_pagespeed encloses url in noscript refresh with '

Post by guradia »

There is a Problem, at least with the nginx-Version of mod_pagespeed and it's meta-refresh to the noscript version of a website.

Visible here: https://staging.mein-deal.com/ (and if pagespeed is activated on the live site: https://www.mein-deal.com)

Pagespeed includes a <noscript>-Tag containing this:

Code: Select all

<meta HTTP-EQUIV="refresh" content="0;url='https://www.mein-deal.com/?PageSpeed=noscript'" />
Notice the ' surrounding the URL. Without NoScript but manually deactivated JavaScript, this is not an issue. With NoScript these ' will be used to produce this URL:

Code: Select all

https://staging.mein-deal.com/'https://staging.mein-deal.com/?PageSpeed=noscript'
Following this URL takes another redirection roundtrip to an even more mangled URL, resulting in 404.

A simple Fix for this is located in a fork on github: https://github.com/guradia/noscript/com ... 0f1034bf0c
Successfully tested in a dev version of FireFox.
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0
Post Reply