From dcae8398bf6f911193d67ef660798c387c4071fc Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Mon, 20 Dec 2010 11:32:54 -0800 Subject: [PATCH] raw does not work with jsonp in the browser, disable it --- lib/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/index.js b/lib/index.js index e7e50e5..5b78a34 100644 --- a/lib/index.js +++ b/lib/index.js @@ -79,7 +79,8 @@ commit: function(repo, sha, cb) { return new Commit(repo, sha, cb) }, - raw: function(repo, sha, cb) { + // raw doesn't work with jsonp ... cors? + raw: isBrowser ? undefined : function(repo, sha, cb) { return new Raw(repo, sha, cb) }, repo: function(repo, cb) { @@ -142,7 +143,8 @@ has: [ ['commits', 'commits/list/:repo/:branch'] ] }) Commit = createResource('commits/show/:repo/:sha') - Raw = createResource('blob/show/:repo/:sha') + // raw doesn't work with jsonp ... cors? + if (!isBrowser) Raw = createResource('blob/show/:repo/:sha') Repo = createResource('repos/show/:repo', { has: [ 'branches' , 'collaborators'