URL Protocol stripped from JS files (breaks forms)
-
Hi,
I’m not sure if this bug/issue/feature was added in a recent update but it’s something I’ve just noticed now (or rather, a client has).
I have a javascript file with a section that looks like this:
if( variable === 'value1' ) { document.forms['bookingForm'].action= "https://www.domain1.com/?p=1"; } else if( variable === 'value2' ) { document.forms['bookingForm'].action= "https://www.domain1.com/?p=2"; } else if( variable === 'value3' ) { document.forms['bookingForm'].action= "https://www.domain3.com/?p=1"; }
When this is processed by Fast Velocity Minify, the URL protocol is stripped from those actions. So the output looks like:
if( variable === 'value1' ) { document.forms['bookingForm'].action= "//www.domain1.com/?p=1"; } else if( variable === 'value2' ) { document.forms['bookingForm'].action= "//www.domain1.com/?p=2"; } else if( variable === 'value3' ) { document.forms['bookingForm'].action= "//www.domain3.com/?p=1"; }
Trouble is, this is running on an HTTPS site, so the redirect will default to having https: at the beginning of each URL (which throws an error on sites that should be http).
Is there a way to turn off this protocol removal? Any suggestions at all? For now I’m just excluding files from FVM, but that’s hardly an ideal solution. Randomly stripping the URL protocol can’t be a sensible idea if it’s done as bluntly as this?
Cheers,
Jim.
- The topic ‘URL Protocol stripped from JS files (breaks forms)’ is closed to new replies.