When using a proxy, the following test fails:

// Protocol changes based on current page TODO.
$protocol = (isset($_SERVER['HTTPS'])) ? 'https' : 'http';

It should probably look something like this:
$protocol = (isset($_SERVER['HTTPS']) || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') ? 'https' : 'http';

CommentFileSizeAuthor
#1 youtube_support_https_protocol-2402589-1.patch595 bytesmpp

Comments

mpp’s picture

Assigned: mpp » Unassigned
Status: Active » Needs review
StatusFileSize
new595 bytes

Please review patch.

  • guschilds committed 2ee6d00 on 7.x-1.x
    Issue #2402589: Fixed HTTPS proxy issues by always embedding https...

  • guschilds committed 8fbc633 on
    Issue #2402589: Fixed HTTPS proxy issues by always embedding https...
guschilds’s picture

Status: Needs review » Fixed

Thanks, mpp. It turns out that YouTube's provided embed code always uses https paths. I don't think there is any problem for having https iframe src on a non-https page, but there is a problem with the opposite. I think the code you discussed is a bit of a relic that was meant to fix that, but I think always using https for the iframe src will also fix it without penalty. It will also fix the problem you've outlined.

I've committed that fix (always use https for the iframe src) to the 7.x-1.x and 8.x-1.x branches. Thanks again.

mpp’s picture

Status: Fixed » Closed (fixed)

You're welcome.
Looks good, thanks.