Line 403-405 of fb_canvas.module has this:

    // Make relative links point to canvas pages.
    $patterns[] = "|<a([^>]*)href=\"{$base}|";
    $replacements[] = "<a $1 href=\"http://apps.facebook.com/{$_fb_app->canvas}/";

The hardcorded http in the replacement pattern will break your app if being accessed from https://apps.facebook.com/

I'm working on a cleaner solution/patch, but I'm testing this right now:

    // Make relative links point to canvas pages.
    $patterns[] = "|<a([^>]*)href=\"{$base}|";
    if($_SERVER['HTTPS']) {
      $replacements[] = "<a $1 href=\"https://apps.facebook.com/{$_fb_app->canvas}/";
    } else {
      $replacements[] = "<a $1 href=\"http://apps.facebook.com/{$_fb_app->canvas}/";
    }

It's ugly as sin, but it seems to be solving the issue for me.

CommentFileSizeAuthor
#3 fb_protocol.diff3.32 KBDave Cohen
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dave Cohen’s picture

Issue tags: +fb3-blocker

Good catch. There's some code in facebook's php sdk that does a test like this...

    $protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on'
      ? 'https://'
      : 'http://';
MacRonin’s picture

Thanks for catching. I was just doing some testing(learning Canvas pages) and getting similar error. (I have HTTPS set as my user's default.)

For most apps it just gives me a warning and asks to temporarily switch to unsecured HTTP. But for my server i can accept either HTTP or HTTPS and route to the same page, so avoiding the warning msg and following switch from HTTPS to HTTP would be great.

BTW I'm on the current DEV version for Drupal - 7

Dave Cohen’s picture

Status: Needs work » Needs review
FileSize
3.32 KB

Here's a patch I'm working with. For D6.

Dave Cohen’s picture

Status: Needs review » Fixed

No feedback, still I'm committing the patch.

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