Skip to content

Commit

Permalink
Fix one more case of connecting outside the proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
bitwiseman committed Oct 4, 2019
1 parent d5b04f5 commit 872d713
Show file tree
Hide file tree
Showing 6 changed files with 213 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/test/java/org/kohsuke/github/GHRepositoryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ public void listLanguages() throws IOException {

@Test // Issue #261
public void listEmptyContributors() throws IOException {
GitHub gh = GitHub.connect();
for (GHRepository.Contributor c : gh.getRepository(GITHUB_API_TEST_ORG + "/empty").listContributors()) {
for (GHRepository.Contributor c : gitHub.getRepository(GITHUB_API_TEST_ORG + "/empty").listContributors()) {
System.out.println(c);
fail("This list should be empty, but should return a valid empty iterable.");
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{
"id": 60391080,
"node_id": "MDEwOlJlcG9zaXRvcnk2MDM5MTA4MA==",
"name": "empty",
"full_name": "github-api-test-org/empty",
"private": false,
"owner": {
"login": "github-api-test-org",
"id": 7544739,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=",
"avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/github-api-test-org",
"html_url": "https://github.com/github-api-test-org",
"followers_url": "https://api.github.com/users/github-api-test-org/followers",
"following_url": "https://api.github.com/users/github-api-test-org/following{/other_user}",
"gists_url": "https://api.github.com/users/github-api-test-org/gists{/gist_id}",
"starred_url": "https://api.github.com/users/github-api-test-org/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/github-api-test-org/subscriptions",
"organizations_url": "https://api.github.com/users/github-api-test-org/orgs",
"repos_url": "https://api.github.com/users/github-api-test-org/repos",
"events_url": "https://api.github.com/users/github-api-test-org/events{/privacy}",
"received_events_url": "https://api.github.com/users/github-api-test-org/received_events",
"type": "Organization",
"site_admin": false
},
"html_url": "https://github.com/github-api-test-org/empty",
"description": "Repository that has no contributor",
"fork": false,
"url": "https://api.github.com/repos/github-api-test-org/empty",
"forks_url": "https://api.github.com/repos/github-api-test-org/empty/forks",
"keys_url": "https://api.github.com/repos/github-api-test-org/empty/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/github-api-test-org/empty/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/github-api-test-org/empty/teams",
"hooks_url": "https://api.github.com/repos/github-api-test-org/empty/hooks",
"issue_events_url": "https://api.github.com/repos/github-api-test-org/empty/issues/events{/number}",
"events_url": "https://api.github.com/repos/github-api-test-org/empty/events",
"assignees_url": "https://api.github.com/repos/github-api-test-org/empty/assignees{/user}",
"branches_url": "https://api.github.com/repos/github-api-test-org/empty/branches{/branch}",
"tags_url": "https://api.github.com/repos/github-api-test-org/empty/tags",
"blobs_url": "https://api.github.com/repos/github-api-test-org/empty/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/github-api-test-org/empty/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/github-api-test-org/empty/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/github-api-test-org/empty/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/github-api-test-org/empty/statuses/{sha}",
"languages_url": "https://api.github.com/repos/github-api-test-org/empty/languages",
"stargazers_url": "https://api.github.com/repos/github-api-test-org/empty/stargazers",
"contributors_url": "https://api.github.com/repos/github-api-test-org/empty/contributors",
"subscribers_url": "https://api.github.com/repos/github-api-test-org/empty/subscribers",
"subscription_url": "https://api.github.com/repos/github-api-test-org/empty/subscription",
"commits_url": "https://api.github.com/repos/github-api-test-org/empty/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/github-api-test-org/empty/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/github-api-test-org/empty/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/github-api-test-org/empty/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/github-api-test-org/empty/contents/{+path}",
"compare_url": "https://api.github.com/repos/github-api-test-org/empty/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/github-api-test-org/empty/merges",
"archive_url": "https://api.github.com/repos/github-api-test-org/empty/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/github-api-test-org/empty/downloads",
"issues_url": "https://api.github.com/repos/github-api-test-org/empty/issues{/number}",
"pulls_url": "https://api.github.com/repos/github-api-test-org/empty/pulls{/number}",
"milestones_url": "https://api.github.com/repos/github-api-test-org/empty/milestones{/number}",
"notifications_url": "https://api.github.com/repos/github-api-test-org/empty/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/github-api-test-org/empty/labels{/name}",
"releases_url": "https://api.github.com/repos/github-api-test-org/empty/releases{/id}",
"deployments_url": "https://api.github.com/repos/github-api-test-org/empty/deployments",
"created_at": "2016-06-04T03:22:22Z",
"updated_at": "2016-06-04T03:22:22Z",
"pushed_at": "2016-06-04T03:22:23Z",
"git_url": "git://github.com/github-api-test-org/empty.git",
"ssh_url": "git@github.com:github-api-test-org/empty.git",
"clone_url": "https://github.com/github-api-test-org/empty.git",
"svn_url": "https://github.com/github-api-test-org/empty",
"homepage": null,
"size": 0,
"stargazers_count": 0,
"watchers_count": 0,
"language": null,
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": false,
"forks_count": 0,
"mirror_url": null,
"archived": false,
"disabled": false,
"open_issues_count": 0,
"license": null,
"forks": 0,
"open_issues": 0,
"watchers": 0,
"default_branch": "master",
"permissions": {
"admin": true,
"push": true,
"pull": true
},
"allow_squash_merge": true,
"allow_merge_commit": true,
"allow_rebase_merge": true,
"organization": {
"login": "github-api-test-org",
"id": 7544739,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=",
"avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/github-api-test-org",
"html_url": "https://github.com/github-api-test-org",
"followers_url": "https://api.github.com/users/github-api-test-org/followers",
"following_url": "https://api.github.com/users/github-api-test-org/following{/other_user}",
"gists_url": "https://api.github.com/users/github-api-test-org/gists{/gist_id}",
"starred_url": "https://api.github.com/users/github-api-test-org/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/github-api-test-org/subscriptions",
"organizations_url": "https://api.github.com/users/github-api-test-org/orgs",
"repos_url": "https://api.github.com/users/github-api-test-org/repos",
"events_url": "https://api.github.com/users/github-api-test-org/events{/privacy}",
"received_events_url": "https://api.github.com/users/github-api-test-org/received_events",
"type": "Organization",
"site_admin": false
},
"network_count": 0,
"subscribers_count": 1
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"email": "bitwiseman@gmail.com",
"hireable": null,
"bio": "https://twitter.com/bitwiseman",
"public_repos": 167,
"public_repos": 168,
"public_gists": 4,
"followers": 136,
"following": 9,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"id": "af73e21a-68d3-4683-a1e1-3415319211e4",
"name": "repos_github-api-test-org_empty",
"request": {
"url": "/repos/github-api-test-org/empty",
"method": "GET"
},
"response": {
"status": 200,
"bodyFileName": "repos_github-api-test-org_empty-af73e21a-68d3-4683-a1e1-3415319211e4.json",
"headers": {
"Date": "Fri, 04 Oct 2019 00:34:14 GMT",
"Content-Type": "application/json; charset=utf-8",
"Server": "GitHub.com",
"Status": "200 OK",
"X-RateLimit-Limit": "5000",
"X-RateLimit-Remaining": "4826",
"X-RateLimit-Reset": "1570151182",
"Cache-Control": "private, max-age=60, s-maxage=60",
"Vary": [
"Accept, Authorization, Cookie, X-GitHub-OTP",
"Accept-Encoding"
],
"ETag": "W/\"71a57ee919c57e5e9eb076f615232a66\"",
"Last-Modified": "Sat, 04 Jun 2016 03:22:22 GMT",
"X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion",
"X-Accepted-OAuth-Scopes": "repo",
"X-GitHub-Media-Type": "unknown, github.v3",
"Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type",
"Access-Control-Allow-Origin": "*",
"Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload",
"X-Frame-Options": "deny",
"X-Content-Type-Options": "nosniff",
"X-XSS-Protection": "1; mode=block",
"Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
"Content-Security-Policy": "default-src 'none'",
"X-GitHub-Request-Id": "D778:2CE6:7EE78B:96BD39:5D969385"
}
},
"uuid": "af73e21a-68d3-4683-a1e1-3415319211e4",
"persistent": true,
"insertionIndex": 2
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"id": "dae0e321-23f5-462b-8d0b-cb67f101e856",
"name": "repos_github-api-test-org_empty_contributors",
"request": {
"url": "/repos/github-api-test-org/empty/contributors",
"method": "GET"
},
"response": {
"status": 204,
"headers": {
"Date": "Fri, 04 Oct 2019 00:34:14 GMT",
"Server": "GitHub.com",
"Status": "204 No Content",
"X-RateLimit-Limit": "5000",
"X-RateLimit-Remaining": "4825",
"X-RateLimit-Reset": "1570151182",
"X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion",
"X-Accepted-OAuth-Scopes": "",
"X-GitHub-Media-Type": "unknown, github.v3",
"Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type",
"Access-Control-Allow-Origin": "*",
"Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload",
"X-Frame-Options": "deny",
"X-Content-Type-Options": "nosniff",
"X-XSS-Protection": "1; mode=block",
"Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
"Content-Security-Policy": "default-src 'none'",
"Vary": "Accept-Encoding",
"X-GitHub-Request-Id": "D778:2CE6:7EE795:96BD55:5D969386"
}
},
"uuid": "dae0e321-23f5-462b-8d0b-cb67f101e856",
"persistent": true,
"insertionIndex": 3
}
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
{
"id": "009b9e10-1f02-4c40-bc83-b37bfd70670e",
"id": "8d2ebbe4-ff50-4d3e-9932-d48541155f86",
"name": "user",
"request": {
"url": "/user",
"method": "GET"
},
"response": {
"status": 200,
"bodyFileName": "user-009b9e10-1f02-4c40-bc83-b37bfd70670e.json",
"bodyFileName": "user-8d2ebbe4-ff50-4d3e-9932-d48541155f86.json",
"headers": {
"Date": "Thu, 03 Oct 2019 18:56:13 GMT",
"Date": "Fri, 04 Oct 2019 00:34:13 GMT",
"Content-Type": "application/json; charset=utf-8",
"Server": "GitHub.com",
"Status": "200 OK",
"X-RateLimit-Limit": "5000",
"X-RateLimit-Remaining": "4879",
"X-RateLimit-Reset": "1570132527",
"X-RateLimit-Remaining": "4828",
"X-RateLimit-Reset": "1570151182",
"Cache-Control": "private, max-age=60, s-maxage=60",
"Vary": [
"Accept, Authorization, Cookie, X-GitHub-OTP",
"Accept-Encoding"
],
"ETag": "W/\"cf6199fecf47b59c42190e1e11147ee2\"",
"ETag": "W/\"af0c41afcacb8ceee14b7d896719c3bd\"",
"Last-Modified": "Tue, 24 Sep 2019 19:32:29 GMT",
"X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion",
"X-Accepted-OAuth-Scopes": "",
Expand All @@ -34,10 +34,10 @@
"X-XSS-Protection": "1; mode=block",
"Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
"Content-Security-Policy": "default-src 'none'",
"X-GitHub-Request-Id": "F373:78E9:F56BC4:1244F1E:5D96444C"
"X-GitHub-Request-Id": "D778:2CE6:7EE777:96BD36:5D969385"
}
},
"uuid": "009b9e10-1f02-4c40-bc83-b37bfd70670e",
"uuid": "8d2ebbe4-ff50-4d3e-9932-d48541155f86",
"persistent": true,
"insertionIndex": 1
}

0 comments on commit 872d713

Please sign in to comment.