Skip to content

oEmbed Providers: Updated the X oEmbed provider to use the x.com domain (closes #21052)#21053

Merged
Migaroez merged 2 commits intomainfrom
v17/bugfix/use-x-domain-for-x-oembed
Dec 5, 2025
Merged

oEmbed Providers: Updated the X oEmbed provider to use the x.com domain (closes #21052)#21053
Migaroez merged 2 commits intomainfrom
v17/bugfix/use-x-domain-for-x-oembed

Conversation

@AndyButland
Copy link
Contributor

Prerequisites

  • I have added steps to test this contribution in the description below

Addresses: #21052

Description

To investigate the linked issue I created an integration test and found it consistently failing with a 520 error from Cloudflare. I noticed we were still using a URL of http://publish.twitter.com/oembed to get the HTML to embed, and changing it to http://publish.x.com/oembed resolved the problem.

Not sure if this is the cause of the reported intermittent error but in any case, it seems likely the old domain could go away at some point, or at least be less well monitored.

I've updated the URL in this PR and added some integration tests. They pass, and previously failed, but have been marked as Explicit just to avoid a random, transient failure in an external dependency causing an issue when we are looking to build in our pipeline.

Testing

Review integration test and manually try embedding a tweet from X in an RTE.

Release

As well as merging for 17.1 this should be cherry-picked back to v16/dev for 16.5.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the X (formerly Twitter) oEmbed provider to use the new x.com domain instead of the deprecated twitter.com domain, addressing intermittent 520 Cloudflare errors. The changes include updating the API endpoint, adding comprehensive integration tests, and improving documentation for the oEmbed service.

Key changes:

  • Updated X oEmbed provider API endpoint from publish.twitter.com to publish.x.com
  • Added integration tests for the X oEmbed provider with multiple test cases
  • Enhanced documentation for IOEmbedService and OEmbedService with XML comments
  • Fixed spelling and formatting in error logging

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/Umbraco.Core/Media/EmbedProviders/X.cs Updated API endpoint from twitter.com to x.com domain
tests/Umbraco.Tests.Integration/Umbraco.Core/Services/OEmbedServiceTests.cs Added new integration test file with 4 test cases for X provider, marked as [Explicit] to avoid CI failures from external dependencies
src/Umbraco.Core/Services/OEmbedService.cs Added XML documentation for class and methods, fixed "oembed" → "oEmbed" spelling, improved code formatting
src/Umbraco.Core/Services/IOEmbedService.cs Added comprehensive XML documentation for interface and GetMarkupAsync method

@AndyButland AndyButland changed the title oEmbed Providers: Updated the X oEmbed provider to use the x.com domain. oEmbed Providers: Updated the X oEmbed provider to use the x.com domain (closes #21052) Dec 4, 2025
Copy link
Contributor

@Migaroez Migaroez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Migaroez Migaroez merged commit 5683ae9 into main Dec 5, 2025
26 checks passed
@Migaroez Migaroez deleted the v17/bugfix/use-x-domain-for-x-oembed branch December 5, 2025 09:39
AndyButland added a commit that referenced this pull request Dec 5, 2025
…in (closes #21052) (#21053)

* Updated the X oEmbed provider to use the x.com domain.

* Fixed issues raised in code review.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants