Permalink
Browse files

Merge pull request #74 from troupe/concealed_membership

When a user has concealed their membership in an organisation the Org.member() method does not work correctly
  • Loading branch information...
2 parents 4ddcb57 + b4da7b9 commit e3327d2fc018e4a4268077226de87dce8415b7b4 @pksunkara committed Dec 3, 2013
Showing with 36 additions and 5 deletions.
  1. +19 −0 lib/octonode/client.js
  2. +2 −2 lib/octonode/org.js
  3. +1 −1 package.json
  4. +12 −0 src/octonode/client.coffee
  5. +2 −2 src/octonode/org.coffee
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -1,6 +1,6 @@
{
"name": "octonode",
- "version": "0.3.8",
+ "version": "0.3.9",
"author": "Pavan Kumar Sunkara <pavan.sss1991@gmail.com> (http://pksunkara.github.com)",
"description": "nodejs wrapper for github v3 api",
"main": "./lib/octonode",
View
@@ -106,6 +106,18 @@ class Client
return callback(err) if err
@errorHandle res, body, callback
+ # Github api GET request
+ getNoFollow: (path, params..., callback) ->
+ request
+ uri: @buildUrl path, params...
+ method: 'GET'
+ followRedirect: false
+ headers:
+ 'User-Agent': 'octonode/0.3 (https://github.com/pksunkara/octonode) terminal/0.0'
+ , (err, res, body) =>
+ return callback(err) if err
+ @errorHandle res, body, callback
+
# Github api POST request
post: (path, content, callback) ->
request
View
@@ -60,9 +60,9 @@ class Org
# Check an organization's member.
# '/orgs/flatiron/members/pksunkara' GET
member: (user, cb) ->
- @client.get "/orgs/#{@name}/members/#{user}", (err, s, b) ->
+ @client.getNoFollow "/orgs/#{@name}/members/#{user}", (err, s, b) ->
return cb(err) if err
- cb null, s is 204
+ cb null, s is 204 or s is 302
# Export module
module.exports = Org

0 comments on commit e3327d2

Please sign in to comment.