{"id":19882123,"url":"https://github.com/codeclimate/octokit-enterprise-bug","last_synced_at":"2025-10-12T20:45:45.243Z","repository":{"id":66245031,"uuid":"73329261","full_name":"codeclimate/octokit-enterprise-bug","owner":"codeclimate","description":null,"archived":false,"fork":false,"pushed_at":"2016-11-10T14:58:12.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-11T18:18:13.720Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codeclimate.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-09T23:17:56.000Z","updated_at":"2016-11-10T15:14:16.000Z","dependencies_parsed_at":"2023-05-18T07:01:12.390Z","dependency_job_id":null,"html_url":"https://github.com/codeclimate/octokit-enterprise-bug","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeclimate%2Foctokit-enterprise-bug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeclimate%2Foctokit-enterprise-bug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeclimate%2Foctokit-enterprise-bug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeclimate%2Foctokit-enterprise-bug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeclimate","download_url":"https://codeload.github.com/codeclimate/octokit-enterprise-bug/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241310526,"owners_count":19941971,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T17:16:27.074Z","updated_at":"2025-10-12T20:45:40.211Z","avatar_url":"https://github.com/codeclimate.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nThe default Github Enterprise installation exposes its API at endpoints\nprefixed with `/api/v3`. The current version of Octokit, however, has a bug\nwhere when configuring the `api_endpoint`, as [recommended](https://github.com/octokit/octokit.rb#working-with-github-enterprise), results in requests to an\nincorrect url.\n\n##Expected behavior:\n\nConfiguring the Octokit client's `api_endpoint` value as\n\n```\nclient = Octokit::Client.new(\n  api_endpoint: \"https://somedomain.com/api/v3\",\n  client_id: \"123\"\n)\n```\n\nthen calling `client.check_application_authorization(\"some-token\")`\n\nshould result in a request to\n\n```\nhttps://somedomain.com/api/v3/applications/abc/tokens/some-token\n```\n\n##Actual behavior:\n\nA request is made to \n\n```\nhttps://somedomain.com/applications/abc/tokens/some-token\n```\n\nNotice the omitted `/api/v3`\n\n##Steps to reproduce\n\nrun `rspec spec/test.rb` from the root of this repository\n\n##Investigation\n\nThe problem can be traced down to where the request url is built in [Faraday](https://github.com/lostisland/faraday/blob/master/lib/faraday/connection.rb#L406)\n\nOn these lines, `base` is a `URI` instance and the `+` operator is defined on `URI` as an alias to `merge` which does not exhibit the same behavior as concatenation and is why the `/api/v3` portion of the path gets lost.\n\n##Proposed resolution\n\nAt the moment, I'm not certain how to correct this issue from Octokit's point of view, but am happy to help.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeclimate%2Foctokit-enterprise-bug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeclimate%2Foctokit-enterprise-bug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeclimate%2Foctokit-enterprise-bug/lists"}