Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client-supplied endpoint gets truncated #38

Closed
boyan opened this issue Jul 3, 2012 · 6 comments
Closed

Client-supplied endpoint gets truncated #38

boyan opened this issue Jul 3, 2012 · 6 comments

Comments

@boyan
Copy link
Contributor

boyan commented Jul 3, 2012

After

Github.endpoint = '<some-url-with-github-enterprise>/api/v3'

'/api/v3' becomes truncated from the host to which requests are made.

@piotrmurach
Copy link
Owner

Thanks Boyan, will look into this. Actually my next step was to make sure that this gem works with any backend including enterprise version.

@piotrmurach
Copy link
Owner

Right, this is fixed now Boyan. You can specify arbitrary paths with your host and these will be preserved during requests. Please install release v0.6.2. Best Piotr

@boyan
Copy link
Contributor Author

boyan commented Jul 15, 2012

Thanks Piotr, it works perfectly!

@boyan
Copy link
Contributor Author

boyan commented Jul 19, 2012

When using OAuth with GitHub Enterprise:

github = Github.new endpoint: '<some-url-with-github-enterprise>/api/v3', client_id: '...', client_secret: '...'
puts github.client.site # https://github.com

I have to manually set github.client.site to <some-url-with-github-enterprise>

Perhaps a nice feature would be when setting the endpoint to automatically set the right URL for OAuth

@piotrmurach
Copy link
Owner

I agree, will look into this probably over the weekend.

@piotrmurach
Copy link
Owner

@boyan, the gem now allows you to set the site for the OAuth similarly to endpoint, the reason why I chose this over the automatic update is that the gem itself generates all those setters and getters during runtime and I wanted to avoid complicating stuff with some heuristic that may very well introduce bugs in the future. In summary, you can do the following to set your enterprise site:

github = Github.new endpoint: ..., site: ...., client_id: ..., client_secret: ....

or

github.client :site => ....

Please download the v0.6.4 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants