# Can't onebox Overwatch Forums topic

**URL:** <https://meta.discourse.org/t/cant-onebox-overwatch-forums-topic/67066>\
**Category:** Support\
**Created:** [7월 26, 2017, 9:38오후 UTC](https://meta.discourse.org/t/cant-onebox-overwatch-forums-topic/67066 "2017-07-26T21:38:29Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yuun](https://avatars.discourse-cdn.com/v4/letter/y/977dab/32.png) [@Yuun](https://meta.discourse.org/u/Yuun)\
**Post date:** [7월 26, 2017, 9:38오후 UTC](https://meta.discourse.org/t/cant-onebox-overwatch-forums-topic/67066/1 "2017-07-26T21:38:29Z")

</div>

> [@Oneboxing of sites with hash (#) in URL not working](https://meta.discourse.org/t/oneboxing-of-sites-with-hash-in-url-not-working/66804):
>
> I’m pretty sure this used to onebox nicely with a highlighted line https://github.com/discourse/discourse-slack-official/blob/master/lib/discourse\_slack/slack.rb#L227 Works fine without the line number

I was just about to post a new topic but I assume this is the same or a related bug due to the `#`.

> [Overwatch Forums](https://us.battle.net/forums/en/overwatch/topic/20758326009?page=4#post-70)

> **[Overwatch Forums](https://us.forums.blizzard.com/en/overwatch/?page=4)**

Onebox removes everything after `/en/` from the URL.

Just an extra case for consideration I suppose, unless it’s completely unrelated.

---

<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:** [7월 29, 2017, 1:05오후 UTC](https://meta.discourse.org/t/cant-onebox-overwatch-forums-topic/67066/2 "2017-07-29T13:05:47Z")

</div>

This issue is not related to `#` in URL. Added on my list to look into.

---

<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:** [8월 4, 2017, 2:09오후 UTC](https://meta.discourse.org/t/cant-onebox-overwatch-forums-topic/67066/3 "2017-08-04T14:09:31Z")

</div>

I looked into this issue and this is because Overwatch Forum is returning different headers when making HEAD request (instead of GET).

```
➜ ~ curl -I https://us.battle.net/forums/en/overwatch/topic/20758326009                    
HTTP/1.1 302 Found
Date: Fri, 04 Aug 2017 13:57:32 GMT
Server: Apache
X-Frame-Options: SAMEORIGIN
Retry-After: 600
Set-Cookie: login.cookies=1; Domain=battle.net; Path=/
Location: https://us.battle.net/forums/
Content-Language: en-US

➜ ~ curl -I https://us.battle.net/forums/
HTTP/1.1 302 Found
Date: Fri, 04 Aug 2017 13:57:47 GMT
Server: Apache
X-Frame-Options: SAMEORIGIN
Retry-After: 600
Set-Cookie: login.cookies=1; Domain=battle.net; Path=/
Location: https://us.battle.net/forums/en/

➜ ~ curl -I https://us.battle.net/forums/en/                           
HTTP/1.1 200 OK
Date: Fri, 04 Aug 2017 13:58:08 GMT
Server: Apache
X-Frame-Options: SAMEORIGIN
Retry-After: 600
Set-Cookie: login.cookies=1; Domain=battle.net; Path=/
Content-Language: en-US
Content-Length: 100225
Content-Type: application/xhtml+xml;charset=UTF-8

```

Since Onebox is [making HEAD request](https://github.com/discourse/discourse/blob/b059a0f789d1953cc0c6e6c2ae86a39e98f42790/lib/final_destination.rb#L82-L86) to resolve the URL before actually oneboxing it, the final URL is different than provided.

Changing `FinalDestination` library to make GET request (instead of HEAD) fixes this issue, but I am not sure if that is the correct approach here (since we don’t need the response body in `FinalDestination` library). What do you think @eviltrout?

---

<div class="post-metadata">

**Author:** ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)\
**Post date:** [8월 4, 2017, 7:50오후 UTC](https://meta.discourse.org/t/cant-onebox-overwatch-forums-topic/67066/4 "2017-08-04T19:50:29Z")

</div>

This actually seems like a bug of Blizzard’s to me. The `HEAD` request is redirecting without remembering what the initial URL was supposed to be.

I have seen other sites fail with a HEAD request, but usually they were small sites and not as big as Blizzard.

I don’t think we should stop using `HEAD` since it’s much more efficient, but perhaps we could add a blacklist of sites to use `GET` instead of `HEAD`?

---

<div class="post-metadata">

**Author:** ![elijah](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elijah/32/104055_2.png) [@elijah](https://meta.discourse.org/u/elijah)\
**Post date:** [8월 5, 2017, 12:00오전 UTC](https://meta.discourse.org/t/cant-onebox-overwatch-forums-topic/67066/5 "2017-08-05T00:00:48Z")

</div>

Blacklist is probably the way to go. Like @eviltrout, I’ve seen sites block HEAD, too. I think some naive site owners think HEAD is just for useless bots.

---

<div class="post-metadata">

**Author:** ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)\
**Post date:** [8월 7, 2017, 2:36오후 UTC](https://meta.discourse.org/t/cant-onebox-overwatch-forums-topic/67066/6 "2017-08-07T14:36:29Z")

</div>

If `HEAD` is blocked it will try `GET` afterwards. The only problem here is if the site returns a `HEAD` response which is wrong 🙂

---

<div class="post-metadata">

**Author:** ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)\
**Post date:** [8월 8, 2017, 9:46오전 UTC](https://meta.discourse.org/t/cant-onebox-overwatch-forums-topic/67066/7 "2017-08-08T09:46:03Z")

</div>

Should be fixed by:  
[https://github.com/discourse/discourse/commit/6cd8203686ac7c2584523394944fdbe905a5a21a](https://github.com/discourse/discourse/commit/6cd8203686ac7c2584523394944fdbe905a5a21a)

Also I fixed images not showing in (will work at next onebox bump):  
[https://github.com/discourse/onebox/commit/2c8f4c2d3e235cb26f344cb2d5a9e49ec824d1eb](https://github.com/discourse/onebox/commit/2c8f4c2d3e235cb26f344cb2d5a9e49ec824d1eb)

---

<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:** [8월 8, 2017, 10:14오전 UTC](https://meta.discourse.org/t/cant-onebox-overwatch-forums-topic/67066/8 "2017-08-08T10:14:38Z")

</div>



---

<div class="post-metadata">

**Author:** ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)\
**Post date:** [8월 8, 2017, 2:14오후 UTC](https://meta.discourse.org/t/cant-onebox-overwatch-forums-topic/67066/9 "2017-08-08T14:14:58Z")

</div>

It works ™

> **[Overwatch Forums](https://us.forums.blizzard.com/en/overwatch/?page=4)**
