oembetter
Advanced tools
Comparing version 0.1.22 to 0.1.23
@@ -61,2 +61,9 @@ var request = require('request'); | ||
oUrl = urls.resolve(response.request.href, oUrl); | ||
if (url.match(/^https:/) && oUrl.match(/^http:/)) { | ||
// Fix for YouTube's bug 12/15/20: issuing HTTP discovery URLs | ||
// but flunking them with a 403 when they arrive | ||
if (oUrl.match(/youtube/) && oUrl.match(/^http:/)) { | ||
oUrl = oUrl.replace(/^http:/, 'https:'); | ||
} | ||
} | ||
break; | ||
@@ -63,0 +70,0 @@ } |
{ | ||
"name": "oembetter", | ||
"version": "0.1.22", | ||
"version": "0.1.23", | ||
"description": "A modern oembed client. Allows you to register filters to improve or supply oembed support for sites that don't normally have it. You can also supply a whitelist of services you trust to prevent XSS attacks.", | ||
@@ -31,3 +31,6 @@ "main": "index.js", | ||
"xml2js": "^0.4.4" | ||
}, | ||
"devDependencies": { | ||
"mocha": "^8.2.1" | ||
} | ||
} |
@@ -188,2 +188,4 @@ # oembetter | ||
0.1.23: workaround for YouTube bug in which video pages contain `http:` recommendations for oembed URLs, but an `http:` request is rejected with a 403 error. Force `https:` for YouTube. | ||
0.1.22: fixed URL parsing bugs impacting use of preconfigured endpoints that already contain some query string parameters. | ||
@@ -190,0 +192,0 @@ |
@@ -77,4 +77,4 @@ var assert = require("assert"); | ||
}); | ||
it('should return no response gracefully for boutell.com', function(done) { | ||
oembetter.fetch('http://boutell.com/', function(err, response) { | ||
it('should return no response gracefully for apostrophecms.com', function(done) { | ||
oembetter.fetch('http://apostrophecms.com/', function(err, response) { | ||
assert(err); | ||
@@ -194,17 +194,3 @@ return done(); | ||
}); | ||
it('Taylor Swift video comes through as type video', function(done) { | ||
oembetter.fetch('https://www.facebook.com/TaylorSwift/videos/10153629261480369/', function(err, response) { | ||
assert(!err); | ||
assert(response.type === 'video'); | ||
return done(); | ||
}); | ||
}); | ||
it('Zuck photo post comes through as rich', function(done) { | ||
oembetter.fetch('https://www.facebook.com/photo.php?fbid=10103741991850131&set=a.529237706231.2034669.4&type=3&theater', function(err, response) { | ||
assert(!err); | ||
assert(response.type === 'rich'); | ||
return done(); | ||
}); | ||
}); | ||
}); | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34472
233
1
567