New blog won't onebox

Since moving our Medium blog to our own subdomain, we are consistently having this error every time we share a blog post on our forum.

I have validated the links with OpenGraph, and they seem to work fine.

Examples:

https://blog.sphere.me/one-year-into-lockdown-how-has-work-life-balance-changed-ad48aa73e57f?source=collection_home---4------1-----------------------

https://blog.sphere.me/chrissy-teigen-and-twitters-reckoning-where-do-digital-spaces-go-from-here-40bf4c149752

screenshot from opengraph.xyz

(p.s talljeff says hi to jeff a!)

2 Likes

Something about your setup is weird.

If I issue a GET to this URL I get a sequence of redirects:

GET → 307 → 302 → 200

However, if I issue a HEAD I get a 200 straight away

HEAD → 200

The way our onebox works is that we try to handle all the redirection dance with a HEAD request first, and pass the already resolved URL and the necessary cookies to the oneboxer engine.

Since your setup is doing different responses for each, this breaks onebox. It’s also quite bad for perfomance when the canonical URL for the article is always two redirects away from rendering, so you may want to fix that.

6 Likes

Thanks Rafael,

All we did (as far as I’m aware) was use Medium’s new custom domain implementation and created the relevant A Name records.

Would this therefore be an issue to raise with Medium? I’ve asked our Head of Infrastructure in case it’s something with how our domain is set up.

2 Likes

Maybe contact Medium support about it?

2 Likes

hi @Falco - i have heard back from Medium support, and this is what they have asked.

Could you tell us what User-Agent header Onebox is sending? We can skip that redirects for requests from bots/scrapers that we can identify.

Could you please let me know how best to respond :pray:

1 Like

Whoa! I missed this! Send him a hug :hugs:

We can also repro with this medium entry which also generates a 500.

2 Likes

@eviltrout hope it’s OK to tag you as I see you worked on this before.

Is this still the correct user agent header that I can send to Medium support?

1 Like

@simonb the failure to onebox was tracked to a bug handling the 307 response here:

This PR will fix it when merged:

3 Likes

That’s fantastic news. Thank you so much! :purple_heart:

3 Likes

The Onebox fixes have been merged in and deployed. You should be good to go now!

6 Likes

Amazing! Thank you so much. Looks like I’ve got a few posts to go back and edit tomorrow :relaxed:

2 Likes