Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

faking user agent to get around some pratts

  • Loading branch information...
commit 81de2fa3528efc0d67e7940173a81c0bc68d1b9b 1 parent d0b0b81
@Swizec authored
Showing with 2 additions and 4 deletions.
  1. +1 −0  lib/unshortener.js
  2. +1 −4 test/unshortener.test.js
View
1  lib/unshortener.js
@@ -11,6 +11,7 @@ exports.expand = function (url, callback) {
var options = {host: url.host,
port: 80,
path: url.pathname,
+ headers: {'User-Agent': 'AppleWebKit/525.13 (KHTML, like Gecko) Safari/525.13.'},
method: 'HEAD'};
var handle = function (res) {
View
5 test/unshortener.test.js
@@ -15,10 +15,7 @@ module.exports = {
var fired = false;
unshortener.expand(urllib.parse('http://t.co/rWP6BP3'),
function (url) {
- assert.strictEqual(url.href, 'https://www.facebook.com/mybrucebruce');
- fired = true;
+ assert.strictEqual(url.href, 'http://www.facebook.com/mybrucebruce');
});
-
- assert.ok(fired);
}
};
Please sign in to comment.
Something went wrong with that request. Please try again.