Skip to content

Commit

Permalink
Merge pull request #291 from octokit/tidy-up-releases-header
Browse files Browse the repository at this point in the history
Deprecate custom Releases Accept header
  • Loading branch information
shiftkey committed Jan 7, 2014
2 parents 60f2905 + 48b4a61 commit d8dbecf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
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

0 comments on commit d8dbecf

Please sign in to comment.