From 1d64210ac5292f32fc2191c3ea1fa313e6b3d5e8 Mon Sep 17 00:00:00 2001 From: Haacked Date: Tue, 29 Oct 2013 16:00:08 -0700 Subject: [PATCH] Fix endpoint URLs for Enterprise support Since Enterprise base URLs end with /api/v3 we need to make sure the endpoints are relative and not absolute. --- Octokit.Tests/Clients/AssigneesClientTests.cs | 6 +- .../Clients/AuthorizationsClientTests.cs | 14 ++--- Octokit.Tests/Clients/IssuesClientTests.cs | 16 ++--- .../Clients/MilestonesClientTests.cs | 12 ++-- .../Clients/MiscellaneousClientTests.cs | 4 +- .../Clients/NotificationsClientTests.cs | 4 +- .../Clients/OrganizationsClientTests.cs | 6 +- Octokit.Tests/Clients/ReleasesClientTests.cs | 4 +- .../Clients/RepositoriesClientTests.cs | 14 ++--- Octokit.Tests/Clients/SshKeysClientTests.cs | 12 ++-- Octokit.Tests/Clients/UsersClientTests.cs | 8 +-- Octokit.Tests/Helpers/UriExtensionsTests.cs | 4 +- Octokit.Tests/Http/ApiConnectionTests.cs | 24 ++++---- Octokit.Tests/Http/ConnectionTests.cs | 58 +++++++++---------- Octokit/Clients/AuthorizationsClient.cs | 10 ++-- Octokit/Clients/MiscellaneousClient.cs | 4 +- Octokit/Clients/OrganizationsClient.cs | 2 +- Octokit/Clients/RepositoriesClient.cs | 8 +-- Octokit/Clients/SshKeysClient.cs | 6 +- Octokit/Clients/UsersClient.cs | 4 +- Octokit/Helpers/ApiUrls.cs | 40 ++++++------- 21 files changed, 130 insertions(+), 130 deletions(-) diff --git a/Octokit.Tests/Clients/AssigneesClientTests.cs b/Octokit.Tests/Clients/AssigneesClientTests.cs index 254da851..d571ea5e 100644 --- a/Octokit.Tests/Clients/AssigneesClientTests.cs +++ b/Octokit.Tests/Clients/AssigneesClientTests.cs @@ -21,7 +21,7 @@ public class AssignessClientTests client.GetForRepository("fake", "repo"); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "/repos/fake/repo/assignees")); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/assignees")); } [Fact] @@ -46,7 +46,7 @@ public class AssignessClientTests var response = Task.Factory.StartNew>(() => new ApiResponse { StatusCode = status }); var connection = Substitute.For(); - connection.GetAsync(Arg.Is(u => u.ToString() == "/repos/foo/bar/assignees/cody"), + connection.GetAsync(Arg.Is(u => u.ToString() == "repos/foo/bar/assignees/cody"), null, null).Returns(response); var apiConnection = Substitute.For(); apiConnection.Connection.Returns(connection); @@ -63,7 +63,7 @@ public class AssignessClientTests var response = Task.Factory.StartNew>(() => new ApiResponse { StatusCode = HttpStatusCode.Conflict }); var connection = Substitute.For(); - connection.GetAsync(Arg.Is(u => u.ToString() == "/repos/foo/bar/assignees/cody"), + connection.GetAsync(Arg.Is(u => u.ToString() == "repos/foo/bar/assignees/cody"), null, null).Returns(response); var apiConnection = Substitute.For(); apiConnection.Connection.Returns(connection); diff --git a/Octokit.Tests/Clients/AuthorizationsClientTests.cs b/Octokit.Tests/Clients/AuthorizationsClientTests.cs index 4938af30..3ddc142c 100644 --- a/Octokit.Tests/Clients/AuthorizationsClientTests.cs +++ b/Octokit.Tests/Clients/AuthorizationsClientTests.cs @@ -34,7 +34,7 @@ namespace Octokit.Tests.Clients authEndpoint.GetAll(); - client.Received().GetAll(Arg.Is(u => u.ToString() == "/authorizations")); + client.Received().GetAll(Arg.Is(u => u.ToString() == "authorizations")); } } @@ -48,7 +48,7 @@ namespace Octokit.Tests.Clients authEndpoint.Get(1); - client.Received().Get(Arg.Is(u => u.ToString() == "/authorizations/1"), null); + client.Received().Get(Arg.Is(u => u.ToString() == "authorizations/1"), null); } } @@ -62,7 +62,7 @@ namespace Octokit.Tests.Clients authEndpoint.Update(1, new AuthorizationUpdate()); - client.Received().Patch(Arg.Is(u => u.ToString() == "/authorizations/1"), + client.Received().Patch(Arg.Is(u => u.ToString() == "authorizations/1"), Args.AuthorizationUpdate); } } @@ -77,7 +77,7 @@ namespace Octokit.Tests.Clients authEndpoint.Create(new NewAuthorization()); - client.Received().Post(Arg.Is(u => u.ToString() == "/authorizations") + client.Received().Post(Arg.Is(u => u.ToString() == "authorizations") , Args.NewAuthorization); } } @@ -92,7 +92,7 @@ namespace Octokit.Tests.Clients authEndpoint.Delete(1); - client.Received().Delete(Arg.Is(u => u.ToString() == "/authorizations/1")); + client.Received().Delete(Arg.Is(u => u.ToString() == "authorizations/1")); } } @@ -107,7 +107,7 @@ namespace Octokit.Tests.Clients authEndpoint.GetOrCreateApplicationAuthentication("clientId", "secret", data); - client.Received().Put(Arg.Is(u => u.ToString() == "/authorizations/clients/clientId"), + client.Received().Put(Arg.Is(u => u.ToString() == "authorizations/clients/clientId"), Args.Object); } @@ -121,7 +121,7 @@ namespace Octokit.Tests.Clients authEndpoint.GetOrCreateApplicationAuthentication("clientId", "secret", data, "two-factor"); client.Received().Put( - Arg.Is(u => u.ToString() == "/authorizations/clients/clientId"), + Arg.Is(u => u.ToString() == "authorizations/clients/clientId"), Args.Object, "two-factor"); } diff --git a/Octokit.Tests/Clients/IssuesClientTests.cs b/Octokit.Tests/Clients/IssuesClientTests.cs index e53a53df..4f0c4a41 100644 --- a/Octokit.Tests/Clients/IssuesClientTests.cs +++ b/Octokit.Tests/Clients/IssuesClientTests.cs @@ -20,7 +20,7 @@ public class IssuesClientTests client.Get("fake", "repo", 42); - connection.Received().Get(Arg.Is(u => u.ToString() == "/repos/fake/repo/issues/42"), + connection.Received().Get(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/42"), null); } @@ -45,7 +45,7 @@ public class IssuesClientTests client.GetAllForCurrent(); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "/issues"), + connection.Received().GetAll(Arg.Is(u => u.ToString() == "issues"), Arg.Any>()); } @@ -57,7 +57,7 @@ public class IssuesClientTests client.GetAllForCurrent(new IssueRequest { SortDirection = SortDirection.Ascending }); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "/issues"), + connection.Received().GetAll(Arg.Is(u => u.ToString() == "issues"), Arg.Is>(d => d.Count == 4 && d["filter"] == "assigned" && d["sort"] == "created" @@ -76,7 +76,7 @@ public class IssuesClientTests client.GetAllForOwnedAndMemberRepositories(); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "/user/issues"), + connection.Received().GetAll(Arg.Is(u => u.ToString() == "user/issues"), Arg.Any>()); } } @@ -91,7 +91,7 @@ public class IssuesClientTests client.GetForRepository("fake", "repo"); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "/repos/fake/repo/issues"), + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/issues"), Arg.Any>()); } @@ -106,7 +106,7 @@ public class IssuesClientTests SortDirection = SortDirection.Ascending }); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "/repos/fake/repo/issues"), + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/issues"), Arg.Is>(d => d.Count == 4 && d["state"] == "open" && d["direction"] == "asc" @@ -144,7 +144,7 @@ public class IssuesClientTests client.Create("fake", "repo", newIssue); - connection.Received().Post(Arg.Is(u => u.ToString() == "/repos/fake/repo/issues"), + connection.Received().Post(Arg.Is(u => u.ToString() == "repos/fake/repo/issues"), newIssue); } @@ -178,7 +178,7 @@ public class IssuesClientTests client.Update("fake", "repo", 42, issueUpdate); - connection.Received().Patch(Arg.Is(u => u.ToString() == "/repos/fake/repo/issues/42"), + connection.Received().Patch(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/42"), issueUpdate); } diff --git a/Octokit.Tests/Clients/MilestonesClientTests.cs b/Octokit.Tests/Clients/MilestonesClientTests.cs index 4a9f6377..f2a3dd2f 100644 --- a/Octokit.Tests/Clients/MilestonesClientTests.cs +++ b/Octokit.Tests/Clients/MilestonesClientTests.cs @@ -18,7 +18,7 @@ public class MilestonesClientTests client.Get("fake", "repo", 42); - connection.Received().Get(Arg.Is(u => u.ToString() == "/repos/fake/repo/milestones/42"), + connection.Received().Get(Arg.Is(u => u.ToString() == "repos/fake/repo/milestones/42"), null); } @@ -44,7 +44,7 @@ public class MilestonesClientTests await client.GetForRepository("fake", "repo"); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "/repos/fake/repo/milestones"), + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/milestones"), Arg.Any>()); } @@ -56,7 +56,7 @@ public class MilestonesClientTests client.GetForRepository("fake", "repo", new MilestoneRequest { SortDirection = SortDirection.Descending }); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "/repos/fake/repo/milestones"), + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/milestones"), Arg.Is>(d => d.Count == 3 && d["direction"] == "desc" && d["state"] == "open" @@ -75,7 +75,7 @@ public class MilestonesClientTests client.Create("fake", "repo", newIssue); - connection.Received().Post(Arg.Is(u => u.ToString() == "/repos/fake/repo/issues"), + connection.Received().Post(Arg.Is(u => u.ToString() == "repos/fake/repo/issues"), newIssue); } @@ -109,7 +109,7 @@ public class MilestonesClientTests client.Update("fake", "repo", 42, milestoneUpdate); - connection.Received().Patch(Arg.Is(u => u.ToString() == "/repos/fake/repo/milestones/42"), + connection.Received().Patch(Arg.Is(u => u.ToString() == "repos/fake/repo/milestones/42"), milestoneUpdate); } @@ -142,7 +142,7 @@ public class MilestonesClientTests client.Delete("fake", "repo", 42); - connection.Received().Delete(Arg.Is(u => u.ToString() == "/repos/fake/repo/milestones/42")); + connection.Received().Delete(Arg.Is(u => u.ToString() == "repos/fake/repo/milestones/42")); } [Fact] diff --git a/Octokit.Tests/Clients/MiscellaneousClientTests.cs b/Octokit.Tests/Clients/MiscellaneousClientTests.cs index ede1479d..8259ccbb 100644 --- a/Octokit.Tests/Clients/MiscellaneousClientTests.cs +++ b/Octokit.Tests/Clients/MiscellaneousClientTests.cs @@ -30,7 +30,7 @@ namespace Octokit.Tests.Clients Assert.Equal("Test", html); connection.Received() - .PostAsync(Arg.Is(u => u.ToString() == "/markdown/raw"), + .PostAsync(Arg.Is(u => u.ToString() == "markdown/raw"), "**Test**", "text/html", "text/plain"); @@ -61,7 +61,7 @@ namespace Octokit.Tests.Clients Assert.Equal(2, emojis.Count); connection.Received() - .GetAsync>(Arg.Is(u => u.ToString() == "/emojis"), null, null); + .GetAsync>(Arg.Is(u => u.ToString() == "emojis"), null, null); } } diff --git a/Octokit.Tests/Clients/NotificationsClientTests.cs b/Octokit.Tests/Clients/NotificationsClientTests.cs index 36ab0949..ba5c843c 100644 --- a/Octokit.Tests/Clients/NotificationsClientTests.cs +++ b/Octokit.Tests/Clients/NotificationsClientTests.cs @@ -11,7 +11,7 @@ namespace Octokit.Tests.Clients [Fact] public void RequestsCorrectUrl() { - var endpoint = new Uri("/notifications", UriKind.Relative); + var endpoint = new Uri("notifications", UriKind.Relative); var connection = Substitute.For(); var client = new NotificationsClient(connection); @@ -26,7 +26,7 @@ namespace Octokit.Tests.Clients [Fact] public void RequestsCorrectUrl() { - var endpoint = new Uri("/repos/banana/split/notifications", UriKind.Relative); + var endpoint = new Uri("repos/banana/split/notifications", UriKind.Relative); var connection = Substitute.For(); var client = new NotificationsClient(connection); diff --git a/Octokit.Tests/Clients/OrganizationsClientTests.cs b/Octokit.Tests/Clients/OrganizationsClientTests.cs index b9e9ad8d..da8cba69 100644 --- a/Octokit.Tests/Clients/OrganizationsClientTests.cs +++ b/Octokit.Tests/Clients/OrganizationsClientTests.cs @@ -31,7 +31,7 @@ namespace Octokit.Tests.Clients orgsClient.Get("orgName"); - client.Received().Get(Arg.Is(u => u.ToString() == "/orgs/orgName"), null); + client.Received().Get(Arg.Is(u => u.ToString() == "orgs/orgName"), null); } [Fact] @@ -53,7 +53,7 @@ namespace Octokit.Tests.Clients orgs.GetAll("username"); - client.Received().GetAll(Arg.Is(u => u.ToString() == "/users/username/orgs")); + client.Received().GetAll(Arg.Is(u => u.ToString() == "users/username/orgs")); } [Fact] @@ -75,7 +75,7 @@ namespace Octokit.Tests.Clients orgs.GetAllForCurrent(); - client.Received().GetAll(Arg.Is(u => u.ToString() == "/user/orgs")); + client.Received().GetAll(Arg.Is(u => u.ToString() == "user/orgs")); } } } diff --git a/Octokit.Tests/Clients/ReleasesClientTests.cs b/Octokit.Tests/Clients/ReleasesClientTests.cs index c6d74c2a..e2869081 100644 --- a/Octokit.Tests/Clients/ReleasesClientTests.cs +++ b/Octokit.Tests/Clients/ReleasesClientTests.cs @@ -19,7 +19,7 @@ namespace Octokit.Tests.Clients releasesClient.GetAll("fake", "repo"); - client.Received().GetAll(Arg.Is(u => u.ToString() == "/repos/fake/repo/releases"), + client.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/releases"), null, "application/vnd.github.manifold-preview"); } @@ -45,7 +45,7 @@ namespace Octokit.Tests.Clients releasesClient.CreateRelease("fake", "repo", data); - client.Received().Post(Arg.Is(u => u.ToString() == "/repos/fake/repo/releases"), + client.Received().Post(Arg.Is(u => u.ToString() == "repos/fake/repo/releases"), data, "application/vnd.github.manifold-preview"); } diff --git a/Octokit.Tests/Clients/RepositoriesClientTests.cs b/Octokit.Tests/Clients/RepositoriesClientTests.cs index 77aac4e5..feeeb080 100644 --- a/Octokit.Tests/Clients/RepositoriesClientTests.cs +++ b/Octokit.Tests/Clients/RepositoriesClientTests.cs @@ -78,7 +78,7 @@ namespace Octokit.Tests.Clients await repositoriesClient.Create("theLogin", new NewRepository { Name = "aName" }); client.Received().Post( - Arg.Is(u => u.ToString() == "/orgs/theLogin/repos"), + Arg.Is(u => u.ToString() == "orgs/theLogin/repos"), Args.NewRepository); } @@ -114,7 +114,7 @@ namespace Octokit.Tests.Clients await repositoriesClient.Delete("theOwner", "theRepoName"); - client.Received().Delete(Arg.Is(u => u.ToString() == "/repos/theOwner/theRepoName")); + client.Received().Delete(Arg.Is(u => u.ToString() == "repos/theOwner/theRepoName")); } } @@ -128,7 +128,7 @@ namespace Octokit.Tests.Clients repositoriesClient.Get("fake", "repo"); - client.Received().Get(Arg.Is(u => u.ToString() == "/repos/fake/repo"), null); + client.Received().Get(Arg.Is(u => u.ToString() == "repos/fake/repo"), null); } [Fact] @@ -167,7 +167,7 @@ namespace Octokit.Tests.Clients repositoriesClient.GetAllForUser("username"); client.Received() - .GetAll(Arg.Is(u => u.ToString() == "/users/username/repos")); + .GetAll(Arg.Is(u => u.ToString() == "users/username/repos")); } [Fact] @@ -190,7 +190,7 @@ namespace Octokit.Tests.Clients repositoriesClient.GetAllForOrg("orgname"); client.Received() - .GetAll(Arg.Is(u => u.ToString() == "/orgs/orgname/repos")); + .GetAll(Arg.Is(u => u.ToString() == "orgs/orgname/repos")); } [Fact] @@ -224,7 +224,7 @@ namespace Octokit.Tests.Clients var readme = await reposEndpoint.GetReadme("fake", "repo"); Assert.Equal("README.md", readme.Name); - client.Received().Get(Arg.Is(u => u.ToString() == "/repos/fake/repo/readme"), + client.Received().Get(Arg.Is(u => u.ToString() == "repos/fake/repo/readme"), null); client.DidNotReceive().GetHtml(Arg.Is(u => u.ToString() == "https://github.example.com/readme"), null); @@ -245,7 +245,7 @@ namespace Octokit.Tests.Clients var readme = await reposEndpoint.GetReadmeHtml("fake", "repo"); - client.Received().GetHtml(Arg.Is(u => u.ToString() == "/repos/fake/repo/readme"), null); + client.Received().GetHtml(Arg.Is(u => u.ToString() == "repos/fake/repo/readme"), null); Assert.Equal("README", readme); } } diff --git a/Octokit.Tests/Clients/SshKeysClientTests.cs b/Octokit.Tests/Clients/SshKeysClientTests.cs index a43a2fc8..29c29af2 100644 --- a/Octokit.Tests/Clients/SshKeysClientTests.cs +++ b/Octokit.Tests/Clients/SshKeysClientTests.cs @@ -26,7 +26,7 @@ namespace Octokit.Tests.Clients [Fact] public void RequestsCorrectUrl() { - var endpoint = new Uri("/user/keys/42", UriKind.Relative); + var endpoint = new Uri("user/keys/42", UriKind.Relative); var client = Substitute.For(); var sshKeysClient = new SshKeysClient(client); @@ -41,7 +41,7 @@ namespace Octokit.Tests.Clients [Fact] public void RequestsCorrectUrl() { - var endpoint = new Uri("/users/username/keys", UriKind.Relative); + var endpoint = new Uri("users/username/keys", UriKind.Relative); var client = Substitute.For(); var sshKeysClient = new SshKeysClient(client); @@ -56,7 +56,7 @@ namespace Octokit.Tests.Clients [Fact] public void RequestsCorrectUrl() { - var endpoint = new Uri("/user/keys", UriKind.Relative); + var endpoint = new Uri("user/keys", UriKind.Relative); var client = Substitute.For(); var sshKeysClient = new SshKeysClient(client); @@ -71,7 +71,7 @@ namespace Octokit.Tests.Clients [Fact] public void SendsUpdateToCorrectUrl() { - var endpoint = new Uri("/user/keys/42", UriKind.Relative); + var endpoint = new Uri("user/keys/42", UriKind.Relative); var data = new SshKeyUpdate(); var client = Substitute.For(); var sshKeysClient = new SshKeysClient(client); @@ -94,7 +94,7 @@ namespace Octokit.Tests.Clients [Fact] public void SendsCreateToCorrectUrl() { - var endpoint = new Uri("/user/keys", UriKind.Relative); + var endpoint = new Uri("user/keys", UriKind.Relative); var data = new SshKeyUpdate(); var client = Substitute.For(); var sshKeysClient = new SshKeysClient(client); @@ -117,7 +117,7 @@ namespace Octokit.Tests.Clients [Fact] public void SendsCreateToCorrectUrl() { - var endpoint = new Uri("/user/keys/42", UriKind.Relative); + var endpoint = new Uri("user/keys/42", UriKind.Relative); var client = Substitute.For(); var sshKeysClient = new SshKeysClient(client); diff --git a/Octokit.Tests/Clients/UsersClientTests.cs b/Octokit.Tests/Clients/UsersClientTests.cs index 97572d60..a3d4fb41 100644 --- a/Octokit.Tests/Clients/UsersClientTests.cs +++ b/Octokit.Tests/Clients/UsersClientTests.cs @@ -29,7 +29,7 @@ namespace Octokit.Tests.Clients [Fact] public void RequestsCorrectUrl() { - var endpoint = new Uri("/users/username", UriKind.Relative); + var endpoint = new Uri("users/username", UriKind.Relative); var client = Substitute.For(); var usersClient = new UsersClient(client); @@ -51,7 +51,7 @@ namespace Octokit.Tests.Clients [Fact] public void RequestsCorrectUrl() { - var endpoint = new Uri("/user", UriKind.Relative); + var endpoint = new Uri("user", UriKind.Relative); var client = Substitute.For(); var usersClient = new UsersClient(client); @@ -73,7 +73,7 @@ namespace Octokit.Tests.Clients [Fact] public void SendsUpdateToCorrectUrl() { - var endpoint = new Uri("/user", UriKind.Relative); + var endpoint = new Uri("user", UriKind.Relative); var client = Substitute.For(); var usersClient = new UsersClient(client); @@ -95,7 +95,7 @@ namespace Octokit.Tests.Clients [Fact] public void SendsUpdateToCorrectUrl() { - var endpoint = new Uri("/user/emails", UriKind.Relative); + var endpoint = new Uri("user/emails", UriKind.Relative); var client = Substitute.For(); var usersClient = new UsersClient(client); diff --git a/Octokit.Tests/Helpers/UriExtensionsTests.cs b/Octokit.Tests/Helpers/UriExtensionsTests.cs index d6b5e571..b6a53719 100644 --- a/Octokit.Tests/Helpers/UriExtensionsTests.cs +++ b/Octokit.Tests/Helpers/UriExtensionsTests.cs @@ -25,7 +25,7 @@ namespace Octokit.Tests.Helpers [Fact] public void AppendsParametersAsQueryStringToRelativeUri() { - var uri = new Uri("/issues", UriKind.Relative); + var uri = new Uri("issues", UriKind.Relative); var uriWithParameters = uri.ApplyParameters(new Dictionary { @@ -33,7 +33,7 @@ namespace Octokit.Tests.Helpers {"bar", "barval"} }); - Assert.Equal(new Uri("/issues?foo=fooval&bar=barval", UriKind.Relative), uriWithParameters); + Assert.Equal(new Uri("issues?foo=fooval&bar=barval", UriKind.Relative), uriWithParameters); } [Fact] diff --git a/Octokit.Tests/Http/ApiConnectionTests.cs b/Octokit.Tests/Http/ApiConnectionTests.cs index e240cec3..9b5df215 100644 --- a/Octokit.Tests/Http/ApiConnectionTests.cs +++ b/Octokit.Tests/Http/ApiConnectionTests.cs @@ -16,7 +16,7 @@ namespace Octokit.Tests.Http [Fact] public async Task MakesGetRequestForItem() { - var getUri = new Uri("/anything", UriKind.Relative); + var getUri = new Uri("anything", UriKind.Relative); IResponse response = new ApiResponse {BodyAsObject = new object()}; var connection = Substitute.For(); connection.GetAsync(Args.Uri, null, null).Returns(Task.FromResult(response)); @@ -41,7 +41,7 @@ namespace Octokit.Tests.Http [Fact] public async Task MakesHtmlRequest() { - var getUri = new Uri("/anything", UriKind.Relative); + var getUri = new Uri("anything", UriKind.Relative); IResponse response = new ApiResponse {Body = ""}; var connection = Substitute.For(); connection.GetHtml(Args.Uri, null).Returns(Task.FromResult(response)); @@ -66,7 +66,7 @@ namespace Octokit.Tests.Http [Fact] public async Task MakesGetRequestForAllItems() { - var getAllUri = new Uri("/anything", UriKind.Relative); + var getAllUri = new Uri("anything", UriKind.Relative); var links = new Dictionary(); var scopes = new List(); IResponse> response = new ApiResponse> @@ -107,7 +107,7 @@ namespace Octokit.Tests.Http [Fact] public async Task MakesPatchRequestWithSuppliedData() { - var patchUri = new Uri("/anything", UriKind.Relative); + var patchUri = new Uri("anything", UriKind.Relative); var sentData = new object(); IResponse response = new ApiResponse {BodyAsObject = new object()}; var connection = Substitute.For(); @@ -124,7 +124,7 @@ namespace Octokit.Tests.Http public async Task EnsuresArgumentNotNull() { var connection = new ApiConnection(Substitute.For()); - var patchUri = new Uri("/", UriKind.Relative); + var patchUri = new Uri("", UriKind.Relative); await AssertEx.Throws(async () => await connection.Patch(null, new object())); await AssertEx.Throws(async () => await connection.Patch(patchUri, null)); } @@ -135,7 +135,7 @@ namespace Octokit.Tests.Http [Fact] public async Task MakesPostRequestWithSuppliedData() { - var postUri = new Uri("/anything", UriKind.Relative); + var postUri = new Uri("anything", UriKind.Relative); var sentData = new object(); IResponse response = new ApiResponse {BodyAsObject = new object()}; var connection = Substitute.For(); @@ -151,7 +151,7 @@ namespace Octokit.Tests.Http [Fact] public async Task MakesUploadRequest() { - var uploadUrl = new Uri("/anything", UriKind.Relative); + var uploadUrl = new Uri("anything", UriKind.Relative); IResponse response = new ApiResponse {BodyAsObject = "the response"}; var connection = Substitute.For(); connection.PostAsync(Args.Uri, Arg.Any(), Args.String, Args.String) @@ -167,7 +167,7 @@ namespace Octokit.Tests.Http [Fact] public async Task EnsuresArgumentsNotNull() { - var postUri = new Uri("/", UriKind.Relative); + var postUri = new Uri("", UriKind.Relative); var connection = new ApiConnection(Substitute.For()); // 2 parameter overload @@ -189,7 +189,7 @@ namespace Octokit.Tests.Http [Fact] public async Task MakesPutRequestWithSuppliedData() { - var putUri = new Uri("/anything", UriKind.Relative); + var putUri = new Uri("anything", UriKind.Relative); var sentData = new object(); IResponse response = new ApiResponse { BodyAsObject = new object() }; var connection = Substitute.For(); @@ -205,7 +205,7 @@ namespace Octokit.Tests.Http [Fact] public async Task MakesPutRequestWithSuppliedDataAndTwoFactorCode() { - var putUri = new Uri("/anything", UriKind.Relative); + var putUri = new Uri("anything", UriKind.Relative); var sentData = new object(); IResponse response = new ApiResponse { BodyAsObject = new object() }; var connection = Substitute.For(); @@ -221,7 +221,7 @@ namespace Octokit.Tests.Http [Fact] public async Task EnsuresArgumentsNotNull() { - var putUri = new Uri("/", UriKind.Relative); + var putUri = new Uri("", UriKind.Relative); var connection = new ApiConnection(Substitute.For()); // 2 parameter overload @@ -247,7 +247,7 @@ namespace Octokit.Tests.Http [Fact] public async Task MakesDeleteRequest() { - var deleteUri = new Uri("/anything", UriKind.Relative); + var deleteUri = new Uri("anything", UriKind.Relative); IResponse response = new ApiResponse {BodyAsObject = new object()}; var connection = Substitute.For(); connection.DeleteAsync(Args.Uri).Returns(Task.FromResult(response)); diff --git a/Octokit.Tests/Http/ConnectionTests.cs b/Octokit.Tests/Http/ConnectionTests.cs index 4da849cf..4bcbb0a7 100644 --- a/Octokit.Tests/Http/ConnectionTests.cs +++ b/Octokit.Tests/Http/ConnectionTests.cs @@ -32,14 +32,14 @@ namespace Octokit.Tests.Http httpClient, Substitute.For()); - await connection.GetAsync(new Uri("/endpoint", UriKind.Relative)); + await connection.GetAsync(new Uri("endpoint", UriKind.Relative)); httpClient.Received(1).Send(Arg.Is(req => req.BaseAddress == ExampleUri && req.ContentType == null && req.Body == null && req.Method == HttpMethod.Get && - req.Endpoint == new Uri("/endpoint", UriKind.Relative))); + req.Endpoint == new Uri("endpoint", UriKind.Relative))); } [Fact] @@ -54,14 +54,14 @@ namespace Octokit.Tests.Http httpClient, Substitute.For()); - await connection.GetAsync(new Uri("/endpoint", UriKind.Relative)); - await connection.GetAsync(new Uri("/endpoint", UriKind.Relative)); - await connection.GetAsync(new Uri("/endpoint", UriKind.Relative)); + await connection.GetAsync(new Uri("endpoint", UriKind.Relative)); + await connection.GetAsync(new Uri("endpoint", UriKind.Relative)); + await connection.GetAsync(new Uri("endpoint", UriKind.Relative)); httpClient.Received(3).Send(Arg.Is(req => req.BaseAddress == ExampleUri && req.Method == HttpMethod.Get && - req.Endpoint == new Uri("/endpoint", UriKind.Relative))); + req.Endpoint == new Uri("endpoint", UriKind.Relative))); } [Fact] @@ -83,7 +83,7 @@ namespace Octokit.Tests.Http httpClient, Substitute.For()); - var resp = await connection.GetAsync(new Uri("/endpoint", UriKind.Relative)); + var resp = await connection.GetAsync(new Uri("endpoint", UriKind.Relative)); Assert.NotNull(resp.ApiInfo); Assert.Equal("user", resp.ApiInfo.AcceptedOauthScopes.First()); } @@ -101,7 +101,7 @@ namespace Octokit.Tests.Http Substitute.For()); var exception = await AssertEx.Throws( - async () => await connection.GetAsync(new Uri("/endpoint", UriKind.Relative))); + async () => await connection.GetAsync(new Uri("endpoint", UriKind.Relative))); Assert.NotNull(exception); } @@ -125,7 +125,7 @@ namespace Octokit.Tests.Http Substitute.For()); var exception = await AssertEx.Throws( - async () => await connection.GetAsync(new Uri("/endpoint", UriKind.Relative))); + async () => await connection.GetAsync(new Uri("endpoint", UriKind.Relative))); Assert.Equal(HttpStatusCode.Unauthorized, exception.StatusCode); } @@ -155,7 +155,7 @@ namespace Octokit.Tests.Http Substitute.For()); var exception = await AssertEx.Throws( - async () => await connection.GetAsync(new Uri("/endpoint", UriKind.Relative))); + async () => await connection.GetAsync(new Uri("endpoint", UriKind.Relative))); Assert.Equal(expectedFactorType, exception.TwoFactorType); } @@ -178,7 +178,7 @@ namespace Octokit.Tests.Http Substitute.For()); var exception = await AssertEx.Throws( - async () => await connection.GetAsync(new Uri("/endpoint", UriKind.Relative))); + async () => await connection.GetAsync(new Uri("endpoint", UriKind.Relative))); Assert.Equal("Validation Failed", exception.Message); Assert.Equal("key is already in use", exception.ApiError.Errors[0].Message); @@ -202,7 +202,7 @@ namespace Octokit.Tests.Http Substitute.For()); var exception = await AssertEx.Throws( - async () => await connection.GetAsync(new Uri("/endpoint", UriKind.Relative))); + async () => await connection.GetAsync(new Uri("endpoint", UriKind.Relative))); Assert.Equal("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting for details.", exception.Message); @@ -226,7 +226,7 @@ namespace Octokit.Tests.Http Substitute.For()); var exception = await AssertEx.Throws( - async () => await connection.GetAsync(new Uri("/endpoint", UriKind.Relative))); + async () => await connection.GetAsync(new Uri("endpoint", UriKind.Relative))); Assert.Equal("Maximum number of login attempts exceeded", exception.Message); Assert.Equal("http://developer.github.com/v3", exception.ApiError.DocumentationUrl); @@ -249,7 +249,7 @@ namespace Octokit.Tests.Http Substitute.For()); var exception = await AssertEx.Throws( - async () => await connection.GetAsync(new Uri("/endpoint", UriKind.Relative))); + async () => await connection.GetAsync(new Uri("endpoint", UriKind.Relative))); Assert.Equal("GONE BYE BYE!", exception.Message); } @@ -271,7 +271,7 @@ namespace Octokit.Tests.Http Substitute.For()); var exception = await AssertEx.Throws( - async () => await connection.GetAsync(new Uri("/endpoint", UriKind.Relative))); + async () => await connection.GetAsync(new Uri("endpoint", UriKind.Relative))); Assert.Equal("YOU SHALL NOT PASS!", exception.Message); } @@ -291,7 +291,7 @@ namespace Octokit.Tests.Http httpClient, Substitute.For()); - await connection.GetHtml(new Uri("/endpoint", UriKind.Relative)); + await connection.GetHtml(new Uri("endpoint", UriKind.Relative)); httpClient.Received(1).Send(Arg.Is(req => req.BaseAddress == ExampleUri && @@ -299,7 +299,7 @@ namespace Octokit.Tests.Http req.Body == null && req.Method == HttpMethod.Get && req.Headers["Accept"] == "application/vnd.github.html" && - req.Endpoint == new Uri("/endpoint", UriKind.Relative))); + req.Endpoint == new Uri("endpoint", UriKind.Relative))); } } @@ -318,14 +318,14 @@ namespace Octokit.Tests.Http httpClient, Substitute.For()); - await connection.PatchAsync(new Uri("/endpoint", UriKind.Relative), new object()); + await connection.PatchAsync(new Uri("endpoint", UriKind.Relative), new object()); httpClient.Received(1).Send(Arg.Is(req => req.BaseAddress == ExampleUri && (string)req.Body == data && req.Method == HttpVerb.Patch && req.ContentType == "application/x-www-form-urlencoded" && - req.Endpoint == new Uri("/endpoint", UriKind.Relative))); + req.Endpoint == new Uri("endpoint", UriKind.Relative))); } } @@ -344,14 +344,14 @@ namespace Octokit.Tests.Http httpClient, Substitute.For()); - await connection.PutAsync(new Uri("/endpoint", UriKind.Relative), new object()); + await connection.PutAsync(new Uri("endpoint", UriKind.Relative), new object()); httpClient.Received(1).Send(Arg.Is(req => req.BaseAddress == ExampleUri && (string)req.Body == data && req.Method == HttpMethod.Put && req.ContentType == "application/x-www-form-urlencoded" && - req.Endpoint == new Uri("/endpoint", UriKind.Relative))); + req.Endpoint == new Uri("endpoint", UriKind.Relative))); } [Fact] @@ -367,7 +367,7 @@ namespace Octokit.Tests.Http httpClient, Substitute.For()); - await connection.PutAsync(new Uri("/endpoint", UriKind.Relative), new object(), "two-factor"); + await connection.PutAsync(new Uri("endpoint", UriKind.Relative), new object(), "two-factor"); httpClient.Received(1).Send(Arg.Is(req => req.BaseAddress == ExampleUri && @@ -375,7 +375,7 @@ namespace Octokit.Tests.Http req.Method == HttpMethod.Put && req.Headers["X-GitHub-OTP"] == "two-factor" && req.ContentType == "application/x-www-form-urlencoded" && - req.Endpoint == new Uri("/endpoint", UriKind.Relative))); + req.Endpoint == new Uri("endpoint", UriKind.Relative))); } } @@ -394,14 +394,14 @@ namespace Octokit.Tests.Http httpClient, Substitute.For()); - await connection.PostAsync(new Uri("/endpoint", UriKind.Relative), new object(), null, null); + await connection.PostAsync(new Uri("endpoint", UriKind.Relative), new object(), null, null); httpClient.Received(1).Send(Arg.Is(req => req.BaseAddress == ExampleUri && req.ContentType == "application/x-www-form-urlencoded" && (string)req.Body == data && req.Method == HttpMethod.Post && - req.Endpoint == new Uri("/endpoint", UriKind.Relative))); + req.Endpoint == new Uri("endpoint", UriKind.Relative))); } [Fact] @@ -471,14 +471,14 @@ namespace Octokit.Tests.Http httpClient, Substitute.For()); - await connection.DeleteAsync(new Uri("/endpoint", UriKind.Relative)); + await connection.DeleteAsync(new Uri("endpoint", UriKind.Relative)); httpClient.Received(1).Send(Arg.Is(req => req.BaseAddress == ExampleUri && req.Body == null && req.ContentType == null && req.Method == HttpMethod.Delete && - req.Endpoint == new Uri("/endpoint", UriKind.Relative))); + req.Endpoint == new Uri("endpoint", UriKind.Relative))); } } @@ -487,8 +487,8 @@ namespace Octokit.Tests.Http [Fact] public void EnsuresAbsoluteBaseAddress() { - Assert.Throws(() => new Connection(new ProductHeaderValue("TestRunner"), new Uri("/foo", UriKind.Relative))); - Assert.Throws(() => new Connection(new ProductHeaderValue("TestRunner"), new Uri("/foo", UriKind.RelativeOrAbsolute))); + Assert.Throws(() => new Connection(new ProductHeaderValue("TestRunner"), new Uri("foo", UriKind.Relative))); + Assert.Throws(() => new Connection(new ProductHeaderValue("TestRunner"), new Uri("foo", UriKind.RelativeOrAbsolute))); } [Fact] diff --git a/Octokit/Clients/AuthorizationsClient.cs b/Octokit/Clients/AuthorizationsClient.cs index 2cee9043..0490b8fc 100644 --- a/Octokit/Clients/AuthorizationsClient.cs +++ b/Octokit/Clients/AuthorizationsClient.cs @@ -54,7 +54,7 @@ namespace Octokit /// The specified . public async Task Get(int id) { - var endpoint = "/authorizations/{0}".FormatUri(id); + var endpoint = "authorizations/{0}".FormatUri(id); return await ApiConnection.Get(endpoint); } @@ -86,7 +86,7 @@ namespace Octokit Ensure.ArgumentNotNullOrEmptyString(clientSecret, "clientSecret"); Ensure.ArgumentNotNull(newAuthorization, "authorization"); - var endpoint = "/authorizations/clients/{0}".FormatUri(clientId); + var endpoint = "authorizations/clients/{0}".FormatUri(clientId); var requestData = new { client_secret = clientSecret, @@ -129,7 +129,7 @@ namespace Octokit Ensure.ArgumentNotNull(newAuthorization, "authorization"); Ensure.ArgumentNotNullOrEmptyString(twoFactorAuthenticationCode, "twoFactorAuthenticationCode"); - var endpoint = "/authorizations/clients/{0}".FormatUri(clientId); + var endpoint = "authorizations/clients/{0}".FormatUri(clientId); var requestData = new { client_secret = clientSecret, @@ -170,7 +170,7 @@ namespace Octokit { Ensure.ArgumentNotNull(authorizationUpdate, "authorizationUpdate"); - var endpoint = "/authorizations/{0}".FormatUri(id); + var endpoint = "authorizations/{0}".FormatUri(id); return await ApiConnection.Patch(endpoint, authorizationUpdate); } @@ -210,7 +210,7 @@ namespace Octokit /// A for the request's execution. public async Task Delete(int id) { - var endpoint = "/authorizations/{0}".FormatUri(id); + var endpoint = "authorizations/{0}".FormatUri(id); await ApiConnection.Delete(endpoint); } } diff --git a/Octokit/Clients/MiscellaneousClient.cs b/Octokit/Clients/MiscellaneousClient.cs index 6bd2c3bb..1ec06af6 100644 --- a/Octokit/Clients/MiscellaneousClient.cs +++ b/Octokit/Clients/MiscellaneousClient.cs @@ -36,7 +36,7 @@ namespace Octokit /// An of emoji and their URI. public async Task> GetEmojis() { - var endpoint = new Uri("/emojis", UriKind.Relative); + var endpoint = new Uri("emojis", UriKind.Relative); var response = await _connection.GetAsync>(endpoint, null, null); return new ReadOnlyDictionary( response.BodyAsObject.ToDictionary(kvp => kvp.Key, kvp => new Uri(kvp.Value))); @@ -50,7 +50,7 @@ namespace Octokit /// The rendered Markdown. public async Task RenderRawMarkdown(string markdown) { - var endpoint = new Uri("/markdown/raw", UriKind.Relative); + var endpoint = new Uri("markdown/raw", UriKind.Relative); var response = await _connection.PostAsync(endpoint, markdown, "text/html", "text/plain"); return response.Body; } diff --git a/Octokit/Clients/OrganizationsClient.cs b/Octokit/Clients/OrganizationsClient.cs index 147b330c..c457b6bd 100644 --- a/Octokit/Clients/OrganizationsClient.cs +++ b/Octokit/Clients/OrganizationsClient.cs @@ -32,7 +32,7 @@ namespace Octokit { Ensure.ArgumentNotNullOrEmptyString(org, "org"); - var endpoint = "/orgs/{0}".FormatUri(org); + var endpoint = "orgs/{0}".FormatUri(org); return await ApiConnection.Get(endpoint); } diff --git a/Octokit/Clients/RepositoriesClient.cs b/Octokit/Clients/RepositoriesClient.cs index faf52dc2..4af767db 100644 --- a/Octokit/Clients/RepositoriesClient.cs +++ b/Octokit/Clients/RepositoriesClient.cs @@ -75,7 +75,7 @@ namespace Octokit Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); Ensure.ArgumentNotNullOrEmptyString(name, "name"); - var endpoint = "/repos/{0}/{1}".FormatUri(owner, name); + var endpoint = "repos/{0}/{1}".FormatUri(owner, name); await ApiConnection.Delete(endpoint); } @@ -94,7 +94,7 @@ namespace Octokit Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); Ensure.ArgumentNotNullOrEmptyString(name, "name"); - var endpoint = "/repos/{0}/{1}".FormatUri(owner, name); + var endpoint = "repos/{0}/{1}".FormatUri(owner, name); return await ApiConnection.Get(endpoint); } @@ -160,7 +160,7 @@ namespace Octokit Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); Ensure.ArgumentNotNullOrEmptyString(name, "name"); - var endpoint = "/repos/{0}/{1}/readme".FormatUri(owner, name); + var endpoint = "repos/{0}/{1}/readme".FormatUri(owner, name); var readmeInfo = await ApiConnection.Get(endpoint, null); return new Readme(readmeInfo, ApiConnection); } @@ -180,7 +180,7 @@ namespace Octokit Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); Ensure.ArgumentNotNullOrEmptyString(name, "name"); - var endpoint = "/repos/{0}/{1}/readme".FormatUri(owner, name); + var endpoint = "repos/{0}/{1}/readme".FormatUri(owner, name); return await ApiConnection.GetHtml(endpoint, null); } } diff --git a/Octokit/Clients/SshKeysClient.cs b/Octokit/Clients/SshKeysClient.cs index f4f37970..e7765eac 100644 --- a/Octokit/Clients/SshKeysClient.cs +++ b/Octokit/Clients/SshKeysClient.cs @@ -14,7 +14,7 @@ namespace Octokit public async Task Get(int id) { - var endpoint = "/user/keys/{0}".FormatUri(id); + var endpoint = "user/keys/{0}".FormatUri(id); return await ApiConnection.Get(endpoint); } @@ -42,13 +42,13 @@ namespace Octokit { Ensure.ArgumentNotNull(key, "key"); - var endpoint = "/user/keys/{0}".FormatUri(id); + var endpoint = "user/keys/{0}".FormatUri(id); return await ApiConnection.Patch(endpoint, key); } public async Task Delete(int id) { - var endpoint = "/user/keys/{0}".FormatUri(id); + var endpoint = "user/keys/{0}".FormatUri(id); await ApiConnection.Delete(endpoint); } diff --git a/Octokit/Clients/UsersClient.cs b/Octokit/Clients/UsersClient.cs index d59ccfbd..f8d063f1 100644 --- a/Octokit/Clients/UsersClient.cs +++ b/Octokit/Clients/UsersClient.cs @@ -13,7 +13,7 @@ namespace Octokit /// public class UsersClient : ApiClient, IUsersClient { - static readonly Uri _userEndpoint = new Uri("/user", UriKind.Relative); + static readonly Uri _userEndpoint = new Uri("user", UriKind.Relative); public UsersClient(IApiConnection apiConnection) : base(apiConnection) { @@ -29,7 +29,7 @@ namespace Octokit { Ensure.ArgumentNotNullOrEmptyString(login, "login"); - var endpoint = "/users/{0}".FormatUri(login); + var endpoint = "users/{0}".FormatUri(login); return await ApiConnection.Get(endpoint); } diff --git a/Octokit/Helpers/ApiUrls.cs b/Octokit/Helpers/ApiUrls.cs index 551084ce..0901117c 100644 --- a/Octokit/Helpers/ApiUrls.cs +++ b/Octokit/Helpers/ApiUrls.cs @@ -8,13 +8,13 @@ namespace Octokit public static class ApiUrls { static readonly Uri _currentUserRepositoriesUrl = new Uri("user/repos", UriKind.Relative); - static readonly Uri _currentUserOrganizationsUrl = new Uri("/user/orgs", UriKind.Relative); - static readonly Uri _currentUserSshKeys = new Uri("/user/keys", UriKind.Relative); - static readonly Uri _currentUserEmailsEndpoint = new Uri("/user/emails", UriKind.Relative); - static readonly Uri _currentUserAuthorizationsEndpoint = new Uri("/authorizations", UriKind.Relative); - static readonly Uri _currentUserNotificationsEndpoint = new Uri("/notifications", UriKind.Relative); - static readonly Uri _currentUserAllIssues = new Uri("/issues", UriKind.Relative); - static readonly Uri _currentUserOwnedAndMemberIssues = new Uri("/user/issues", UriKind.Relative); + static readonly Uri _currentUserOrganizationsUrl = new Uri("user/orgs", UriKind.Relative); + static readonly Uri _currentUserSshKeys = new Uri("user/keys", UriKind.Relative); + static readonly Uri _currentUserEmailsEndpoint = new Uri("user/emails", UriKind.Relative); + static readonly Uri _currentUserAuthorizationsEndpoint = new Uri("authorizations", UriKind.Relative); + static readonly Uri _currentUserNotificationsEndpoint = new Uri("notifications", UriKind.Relative); + static readonly Uri _currentUserAllIssues = new Uri("issues", UriKind.Relative); + static readonly Uri _currentUserOwnedAndMemberIssues = new Uri("user/issues", UriKind.Relative); /// /// Returns the that returns all of the repositories for the currently logged in user in @@ -33,7 +33,7 @@ namespace Octokit /// public static Uri Repositories(string login) { - return "/users/{0}/repos".FormatUri(login); + return "users/{0}/repos".FormatUri(login); } /// @@ -44,7 +44,7 @@ namespace Octokit /// public static Uri OrganizationRepositories(string organization) { - return "/orgs/{0}/repos".FormatUri(organization); + return "orgs/{0}/repos".FormatUri(organization); } /// @@ -63,7 +63,7 @@ namespace Octokit /// public static Uri Organizations(string login) { - return "/users/{0}/orgs".FormatUri(login); + return "users/{0}/orgs".FormatUri(login); } /// @@ -82,7 +82,7 @@ namespace Octokit /// public static Uri SshKeys(string login) { - return "/users/{0}/keys".FormatUri(login); + return "users/{0}/keys".FormatUri(login); } /// @@ -102,7 +102,7 @@ namespace Octokit /// public static Uri Releases(string owner, string name) { - return "/repos/{0}/{1}/releases".FormatUri(owner, name); + return "repos/{0}/{1}/releases".FormatUri(owner, name); } /// @@ -132,7 +132,7 @@ namespace Octokit /// public static Uri Notifications(string owner, string name) { - return "/repos/{0}/{1}/notifications".FormatUri(owner, name); + return "repos/{0}/{1}/notifications".FormatUri(owner, name); } /// @@ -162,7 +162,7 @@ namespace Octokit /// public static Uri Issues(string owner, string name) { - return "/repos/{0}/{1}/issues".FormatUri(owner, name); + return "repos/{0}/{1}/issues".FormatUri(owner, name); } /// @@ -173,7 +173,7 @@ namespace Octokit /// public static Uri Issues(string organization) { - return "/orgs/{0}/issues".FormatUri(organization); + return "orgs/{0}/issues".FormatUri(organization); } /// @@ -185,7 +185,7 @@ namespace Octokit /// public static Uri Issue(string owner, string name, int number) { - return "/repos/{0}/{1}/issues/{2}".FormatUri(owner, name, number); + return "repos/{0}/{1}/issues/{2}".FormatUri(owner, name, number); } /// @@ -196,7 +196,7 @@ namespace Octokit /// public static Uri Assignees(string owner, string name) { - return "/repos/{0}/{1}/assignees".FormatUri(owner, name); + return "repos/{0}/{1}/assignees".FormatUri(owner, name); } /// @@ -209,7 +209,7 @@ namespace Octokit /// public static Uri CheckAssignee(string owner, string name, string login) { - return "/repos/{0}/{1}/assignees/{2}".FormatUri(owner, name, login); + return "repos/{0}/{1}/assignees/{2}".FormatUri(owner, name, login); } /// @@ -221,7 +221,7 @@ namespace Octokit /// public static Uri Milestone(string owner, string name, int number) { - return "/repos/{0}/{1}/milestones/{2}".FormatUri(owner, name, number); + return "repos/{0}/{1}/milestones/{2}".FormatUri(owner, name, number); } /// @@ -232,7 +232,7 @@ namespace Octokit /// public static Uri Milestones(string owner, string name) { - return "/repos/{0}/{1}/milestones".FormatUri(owner, name); + return "repos/{0}/{1}/milestones".FormatUri(owner, name); } } }