simonb
(Simon - Community Manager at Sphere )
March 25, 2021, 5:41pm
1
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
Falco
(Falco)
March 25, 2021, 8:30pm
2
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
simonb
(Simon - Community Manager at Sphere )
March 25, 2021, 8:47pm
3
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
Falco
(Falco)
March 25, 2021, 9:07pm
4
Maybe contact Medium support about it?
2 Likes
simonb
(Simon - Community Manager at Sphere )
May 7, 2021, 4:05pm
5
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
1 Like
Whoa! I missed this! Send him a hug
We can also repro with this medium entry which also generates a 500.
2 Likes
simonb
(Simon - Community Manager at Sphere )
May 11, 2021, 4:02pm
9
@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
Falco
(Falco)
May 11, 2021, 4:41pm
10
@simonb the failure to onebox was tracked to a bug handling the 307 response here:
Falco:
GET → 307 → 302 → 200
This PR will fix it when merged:
discourse:master
← discourse:additional-redirect-codes
opened 09:16PM - 10 May 21 UTC
Don’t throw errors if we encounter 303, 307 or 308 HTTP status codes in response… s
3 Likes
simonb
(Simon - Community Manager at Sphere )
May 11, 2021, 6:40pm
11
That’s fantastic news. Thank you so much!
3 Likes
The Onebox fixes have been merged in and deployed. You should be good to go now!
6 Likes
simonb
(Simon - Community Manager at Sphere )
May 14, 2021, 1:09am
13
Amazing! Thank you so much. Looks like I’ve got a few posts to go back and edit tomorrow
2 Likes