# Onebox doesn't prefer secure\_url with HTTPS

**URL:** https://meta.discourse.org/t/onebox-doesnt-prefer-secure-url-with-https/54994
**Category:** Bug
**Created:** [December 30, 2016, 11:08pm UTC](https://meta.discourse.org/t/onebox-doesnt-prefer-secure-url-with-https/54994 "2016-12-30T23:08:48Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![DanielMarquard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/danielmarquard/32/74010_2.png) [@DanielMarquard](https://meta.discourse.org/u/DanielMarquard)
#### Post date: [December 30, 2016, 11:08pm UTC](https://meta.discourse.org/t/onebox-doesnt-prefer-secure-url-with-https/54994/1 "2016-12-30T23:08:48Z")

</div>

Twitch stream embeds are not loaded when linked to from posts on Discourse installs using HTTPS. It seems like `og:video:secure_url` is not being preferred over `og:video` by Onebox, but I think it probably should be, at least on secure websites.

Here’s an example:

https://player.twitch.tv/?channel=moonmoon&parent=meta.discourse.org&autoplay=false

^ This is `https://www.twitch.tv/moonmoon`

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [December 31, 2016, 12:10am UTC](https://meta.discourse.org/t/onebox-doesnt-prefer-secure-url-with-https/54994/2 "2016-12-31T00:10:30Z")

</div>

Sure that makes sense can you fix @techAPJ?

---

<div class="post-metadata">

### Author: ![DanielMarquard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/danielmarquard/32/74010_2.png) [@DanielMarquard](https://meta.discourse.org/u/DanielMarquard)
#### Post date: [December 31, 2016, 1:55am UTC](https://meta.discourse.org/t/onebox-doesnt-prefer-secure-url-with-https/54994/3 "2016-12-31T01:55:29Z")

</div>

Thanks, guys. I realized that even if Twitch embeds loaded properly, they’d auto-play in posts. Auto-playing videos annoy the hell out of me, so I wrote a [Twitch Onebox plugin](https://meta.discourse.org/t/twitch-onebox-for-discourse/54997) to fix both problems.

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [January 3, 2017, 6:42pm UTC](https://meta.discourse.org/t/onebox-doesnt-prefer-secure-url-with-https/54994/4 "2017-01-03T18:42:51Z")

</div>

> [@DanielMarquard](#):
>
> It seems like og:video:secure\_url is not being preferred over og:video by Onebox, but I think it probably should be

Agreed. Fixed via:

[https://github.com/discourse/onebox/commit/d8da08da59e3e65fd1a58060afe5840d8fb42cf9](https://github.com/discourse/onebox/commit/d8da08da59e3e65fd1a58060afe5840d8fb42cf9)

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [January 3, 2017, 6:43pm UTC](https://meta.discourse.org/t/onebox-doesnt-prefer-secure-url-with-https/54994/5 "2017-01-03T18:43:48Z")

</div>


