openx.inc includes the following part:

  if (!empty($_SERVER['HTTPS'])) {
    $protocol = 'https';
    $server = variable_get('openx_delivery_url_https', 'd.openx.org');
  }
  else {
    $protocol = 'http';
    $server = variable_get('openx_delivery_url', 'd.openx.org');
  }

I set HTTPS to either "on" or "off" when passing the request to PHP via FastCGI, and the above check treats both values as true and selects to use https.

To make it work, I substituted the condition with the one used in Drupal's includes/bootstrap.inc.

Please review the attached patch and consider it for inclusion.

Comments

wuinfo - bill wu’s picture

Issue summary: View changes
Status: Needs review » Needs work

Thanks for the patch.

Does this patch assume if $_SERVER['HTTPS'] is not set, it is http.

Is it behind reverse proxy?

I think we can remove the logic of checking https and http. just use generic one //sample.com/

wuinfo - bill wu’s picture

Moving this function to client side. like following code from Google

var _gaq = _gaq || [];
_gaq.push(["_setAccount", "UA-xxxxxxxxx-7"]);
_gaq.push(["_trackPageview"]);
(function () {
    var ga = document.createElement("script");
    ga.type = "text/javascript";
    ga.async = true;
    ga.src = ("https:" == document.location.protocol ? "https://ssl" : "http://www") + ".google-analytics.com/ga.js";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(ga, s);
})();
wuinfo - bill wu’s picture

StatusFileSize
new1.14 KB

Here is patch to move this function to client side. I think it is less code and more reliable. This patch base on 7.x-2.x dev.

wuinfo - bill wu’s picture

Status: Needs work » Fixed

Code is committed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.