Skip to content

Commit 7aa1084

Browse files
committed
oembed: add __oembedError to enable optional meta fallbacks
1 parent f93d596 commit 7aa1084

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

lib/plugins/system/oembed/oembed.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,19 @@ export default {
129129

130130
if (error && !oembed) {
131131
return cb('Oembed error "'+ oembedLinks[0].href + '": ' + error, {
132-
oembedError: error
132+
oembedError: error,
133+
__oembedError: error // To enable fallbacks to optional meta
133134
});
134135
} else if (error && oembed) { // via `options.parseErrorBody = true`
135136
return cb(null, {
136137
oembedError: {
137138
code: error,
138139
body: oembed
139-
}
140+
},
141+
__oembedError: { // To enable fallbacks to optional meta
142+
code: error,
143+
body: oembed
144+
},
140145
});
141146
}
142147

plugins/domains/soundcloud.com/soundcloud-oembed-error.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ export default {
22

33
provides: ['__allow_soundcloud_meta', 'iframe'],
44

5-
getData: function(oembedError, twitter, options, plugins, cb) {
5+
getData: function(__oembedError, twitter, options, plugins, cb) {
6+
var oembedError = __oembedError;
67
var disable_private = options.getProviderOptions('soundcloud.disable_private', false)
78
if (oembedError === 403 && !disable_private && twitter.player) {
89
return cb(null, {

0 commit comments

Comments
 (0)