Skip to content

Commit

Permalink
domains: fix canonical URL for Facebook's shared videos
Browse files Browse the repository at this point in the history
  • Loading branch information
iparamonau committed Aug 28, 2024
1 parent c1b0459 commit 17afb46
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions plugins/domains/facebook.com/facebook.thumbnail.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,17 @@ export default {
},


getData: function(oembed, options) {
getData: function(oembed, url, options) {

if (oembed.html && /class=\"fb\-(post|video)\"/i.test(oembed.html)
&& options.getProviderOptions('facebook.thumbnail', true) && !/comment_id=/.test(oembed.html)) {

options.followHTTPRedirect = true; // avoid security re-directs of URLs if any
// Avoid security re-directs of URLs if any,
// but fix canonical URLs for /share urls that now redirect to story.php
if (!/facebook\.com\/(permalink|story)\.php\?/i.test(url)) {
options.followHTTPRedirect = true;
}

options.exposeStatusCode = true;
options.provider = 'Facebook';

Expand Down

0 comments on commit 17afb46

Please sign in to comment.