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

A note regarding baseURL's for enterprise Github instances. #958

Closed
vanugrah opened this issue Jul 25, 2018 · 2 comments
Closed

A note regarding baseURL's for enterprise Github instances. #958

vanugrah opened this issue Jul 25, 2018 · 2 comments

Comments

@vanugrah
Copy link

To whomsoever it may concern,

There is an important caveat regarding the baseURL when creating clients for enterprise Github instances ( for example with the NewEnterpriseClient method).

The baseURL of the public facing API is simply: https://api.github.com/"
However for enterprise Github instances the baseURL for the API is slightly different: https://<mycompany>.github.com/api/v3/"

Using a baseURL without the /api/v3/ suffix will result in HTTP 406 Not Acceptable errors and lead you down a path of debugging Oauth clients and request headers. I learnt this after many hours and tears.

Documenting this as an issue to help others in the future. Perhaps we could add note on the godoc regarding the difference in baseURL structures between public and enterprise Github.

@gmlewis
Copy link
Collaborator

gmlewis commented Jul 25, 2018

Thank you, @vanugrah! We definitely want to make life easier for Enterprise GitHub users of this package.

We would greatly appreciate PRs that would help others to reduce or eliminate their pain points. If you or others could create these PRs (who are actually using this package with Enterprise GitHub), that would be excellent.

Also, wouldn't the baseURL be https://github.<mycompany>.com/api/v3/ for Enterprise users?

@vanugrah
Copy link
Author

vanugrah commented Jul 31, 2018

Thanks for the reply @gmlewis - I'll submit a PR shortly. And you're right about the baseURL, it should be https://github.<mycompany>.com/api/v3/ - serves me right for trying to create an issue while sleep deprived haha.

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