Closed johncarter- closed 1 year ago
Hi @johncarter Yes, Indeed there seems to be a problem with some hosting providers. I had a report coming from German servers having the same problem adn while doing the debug we found this instances where something similar happened:
https://twittercommunity.com/t/oembed-responses-are-returns-with-code-404/136813 (April 2020) https://twittercommunity.com/t/oembed-404/167966 (Mรคrz 2022) https://twittercommunity.com/t/issue-with-twitter-oembed-api-when-accessed-from-digitalocean-droplets/194215 (May 2023)
Lets see if twitter responds
There seems to be a solution to this problem:
Given the ip address ranges described here: https://developer.twitter.com/en/blog/product-news/2022/updated-source-ip-address-range
You need to allow all TCP connections from those IP ranges.
https://300m.com/security/twitter-oembed-broken-on-digitalocean/
Let me know if this works for you.
I can confirm the following works:
Go to Digital Ocean control panel > Networking > Firewalls (tab) > Create Firewall
Add the following rules:
Assign that rule to your Droplet.
Profit ๐ท
Thanks again for the package and prompt response, it's highly appreciated.
No problem @johncarter- ! Thanks for the feedback, Im closing this issue. :+1:
Thanks for such a great package.
I am using Laravel, locally using Laravel Sail and in production using a Laravel Forge provisioned Digital Ocean droplet.
I am running this code:
It seems that Twitter embeds return an empty array every time on production, but work locally.
Does you have any suggestions why that could be?
Thanks again.