Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

When a user has concealed their membership in an organisation the Org.member() method does not work correctly #74

Merged
merged 3 commits into from Dec 3, 2013

Conversation

Projects
None yet
3 participants
Contributor

suprememoocow commented Dec 3, 2013

In this case, Github returned a 302 Found with a redirection to the public_membership resource, however, the fact that the 302 was returned as opposed to a 404 is enough to indicate membership (when membership is concealed, the redirected URL will return a 404). When the user is not a member of an org, GitHub will return a 404 immediately.

Please let me know if you want me to rework this in any way.

@pksunkara pksunkara and 1 other commented on an outdated diff Dec 3, 2013

src/octonode/client.coffee
@@ -106,6 +106,16 @@ 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'
+ , @handleResponse(callback)
@pksunkara

pksunkara Dec 3, 2013

Owner

What's this?

Shouldn't this be the same as above in get ?

@suprememoocow

suprememoocow Dec 3, 2013

Contributor

Well, it's identical to get, but includes the followRedirect: false attribute. If you prefer I do it another way, let me know

@pksunkara

pksunkara Dec 3, 2013

Owner

Not that. lol.

I meant about @handleResponse. It doesn't exist.

Sorry about that. I've been experimenting with something and had merged it across into the wrong branch by accident.

This commit should fix it.

@pksunkara pksunkara added a commit that referenced this pull request Dec 3, 2013

@pksunkara pksunkara 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
e3327d2

@pksunkara pksunkara merged commit e3327d2 into pksunkara:master Dec 3, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment