Browse files

Added timeout overide.

  • Loading branch information...
1 parent 20cce8c commit 303090c955697208d6bf5be5dd5c40dcc4850861 @kr1zmo committed Dec 20, 2012
Showing with 5 additions and 5 deletions.
  1. +5 −5 fb.js
View
10 fb.js
@@ -22,7 +22,7 @@ var log = function() {
*/
var settings = {
url : "graph.facebook.com",
- timeout : 15,
+ timeout : 15000,
appId : "",
appSecret : "",
signedRequestData: {},
@@ -49,7 +49,7 @@ api = function(url, opts, callback) {
var default_opts = {
json: true,
url: this._settings.url,
- timeout: 15000,
+ timeout: this._settings.timeout,
qs: {}
};
@@ -60,21 +60,21 @@ api = function(url, opts, callback) {
opts = _.extend(default_opts, opts);
- if (_.has(opts, "https") &&
- opts.https) {
+ if (_.has(opts, "https") && opts.https) {
opts.url = "https://" + opts.url;
}
else {
opts.url = "http://" + opts.url;
}
-
}
+
/**
* @fail: use default opts
* valid object wasn't there
*/
else {
+ opts.url = "http://" + opts.url;
opts = default_opts;
}

0 comments on commit 303090c

Please sign in to comment.