Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insecure file transfer on reverse proxy server because protocol is being set incorrectly #67

Open
vjonesmuth opened this issue Sep 23, 2016 · 0 comments

Comments

@vjonesmuth
Copy link

Browser throws requests error on reverse proxy server setups or load balanced servers because protocol was set incorrectly. I fixed this locally by adding to our craft/config/general.php :

// restore reverse proxy forwarding headers to support craft and plugin
// functionality that is depending on default server global attributes
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) {
$_SERVER['HTTPS'] = true;
$_SERVER['SERVER_PORT'] = 443;
}

This issue should be able to be resolved by updating GoogleMaps_TemplateService.php function isSecure() to accommodate HTTP_X_FORWARDED_PROTO being set.

This should be able to be cleared up as well by removing the isSecure function all together and on line 19 of GoogleMaps_TemplatesService.php removing the protocol variable are starting the script tag with "//" to let the server decide how to send the request. ex. : craft()->templates->includeJsFile('//maps.google.com/maps/api/js?sensor=true&libraries=geometry'.($key ? 'key='.$key : ''));

This is the error message that was displayed on our staging server with the reverse proxy while editing a matrix field.
screen shot 2016-09-23 at 2 29 24 pm

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

No branches or pull requests

1 participant