statiqdev / Statiq.Web

Statiq Web is a flexible static site generator written in .NET.
https://statiq.dev/web
Other
1.64k stars 235 forks source link

Add text/xml to ContextType of oEmbed response #961

Open Ovis opened 2 years ago

Ovis commented 2 years ago

Hi. I'm trying to create a ShortCode that can use oEmbed in a generic way. Internally, it is assumed to use GetEmbedResultAsync.

During creation, an error occurred when retrieving information from Flickr. e.g) Unknown content type for oEmbed response

I checked and found that Flickr's oEmbedAPI specifies text/xml as ContextType.

https://github.com/statiqdev/Statiq.Web/blob/d9da990fd75b14575d7679273373d7ab5da54b78/src/Statiq.Web/Shortcodes/EmbedShortcode.cs#L99

GetEmbedResultAsync seems to have an error because it assumes Application/Xml.

Could you please fix this branch to allow text/xml?

e.g.) https://www.flickr.com/services/oembed/?url=https://www.flickr.com/photos/yuta_arai_0206/8008087593/