Skip to content

Commit

Permalink
faking user agent to get around some pratts
Browse files Browse the repository at this point in the history
  • Loading branch information
Swizec committed May 18, 2011
1 parent d0b0b81 commit 81de2fa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions lib/unshortener.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 1 addition & 4 deletions test/unshortener.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
};

0 comments on commit 81de2fa

Please sign in to comment.