Module does not work when site use HTTPS (Mixed content error)

Created on 4 September 2017, almost 8 years ago
Updated 18 March 2021, about 4 years ago

When using HTTPS for the site, the module is not working correctly.

How to reproduce
1. Add a field of type comment to a content type
2. Install and enable ajax_comments module for that content type
3. Enable https
4. Try to post a new comment or to reply to an existing one

Expected behaviour
When the user clicks on "save" on the comment form, the comment is saved and it appears on the comment list.

Bug
The comment is successfully posted but it doesn't appear on the comment list. Instead, an error arises in the console:
Mixed Content: The page at 'https://xxxx/node/1' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://xxxx/ajax_comments/save_reply/node/1/field_comment/1?_wrapper_format=drupal_ajax'. This request has been blocked; the content must be served over HTTPS.

🐛 Bug report
Status

Closed: works as designed

Version

1.0

Component

Code

Created by

🇮🇹Italy mithenks

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇨🇳China huangweiqiu

    Even if you don't have reverse service on your own server but if you use Cloudflare 's cache services ,you also need to set:~

    $settings['reverse_proxy'] = TRUE;
    $settings['reverse_proxy_addresses'] = array($_SERVER['REMOTE_ADDR']);
Production build 0.71.5 2024