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

Deprecate custom Releases Accept header #291

Merged
merged 1 commit into from
Jan 7, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Octokit.Tests/Clients/ReleasesClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void RequestsCorrectUrl()

client.Received().GetAll<Release>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/releases"),
null,
"application/vnd.github.manifold-preview");
"application/vnd.github.v3");
}

[Fact]
Expand All @@ -47,7 +47,7 @@ public void RequestsCorrectUrl()

client.Received().Post<Release>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/releases"),
data,
"application/vnd.github.manifold-preview");
"application/vnd.github.v3");
}

[Fact]
Expand Down Expand Up @@ -82,7 +82,7 @@ public void UploadsToCorrectUrl()
client.Received().Post<ReleaseAsset>(
Arg.Is<Uri>(u => u.ToString() == "https://uploads.test.dev/does/not/matter/releases/1/assets?name=example.zip"),
rawData,
"application/vnd.github.manifold-preview",
"application/vnd.github.v3",
Arg.Is<string>(contentType => contentType == "application/zip"));
}

Expand Down
4 changes: 2 additions & 2 deletions Octokit.Tests/Http/JsonHttpPipelineTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ public void SetsRequestAcceptHeader()
public void DoesNotChangeExistingAcceptsHeader()
{
var request = new Request();
request.Headers.Add("Accept", "application/vnd.github.manifold-preview; charset=utf-8");
request.Headers.Add("Accept", "application/vnd.github.v3; charset=utf-8");
var jsonPipeline = new JsonHttpPipeline();

jsonPipeline.SerializeRequest(request);

Assert.Contains("Accept", request.Headers.Keys);
Assert.Equal("application/vnd.github.manifold-preview; charset=utf-8", request.Headers["Accept"]);
Assert.Equal("application/vnd.github.v3; charset=utf-8", request.Headers["Accept"]);
}

[Fact]
Expand Down
6 changes: 3 additions & 3 deletions Octokit/Clients/ReleasesClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public Task<IReadOnlyList<Release>> GetAll(string owner, string name)
Ensure.ArgumentNotNullOrEmptyString(name, "repository");

var endpoint = ApiUrls.Releases(owner, name);
return ApiConnection.GetAll<Release>(endpoint, null, "application/vnd.github.manifold-preview");
return ApiConnection.GetAll<Release>(endpoint, null, "application/vnd.github.v3");
}

/// <summary>
Expand All @@ -58,7 +58,7 @@ public Task<Release> CreateRelease(string owner, string name, ReleaseUpdate data
Ensure.ArgumentNotNull(data, "data");

var endpoint = ApiUrls.Releases(owner, name);
return ApiConnection.Post<Release>(endpoint, data, "application/vnd.github.manifold-preview");
return ApiConnection.Post<Release>(endpoint, data, "application/vnd.github.v3");
}

/// <summary>
Expand All @@ -80,7 +80,7 @@ public Task<ReleaseAsset> UploadAsset(Release release, ReleaseAssetUpload data)
return ApiConnection.Post<ReleaseAsset>(
endpoint,
data.RawData,
"application/vnd.github.manifold-preview",
"application/vnd.github.v3",
data.ContentType);
}
}
Expand Down