mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-03 03:01:31 +00:00
(fix) RepositoryContentsClient.GetArchive does not return the expected binary content (#2803)
* (GH-2802) Add unit test to demonstrate the problem This unit test currently fails which demonstrates the problem and it should pass when I am done with the PR * (GH-2802) Add a GetRaw method that accepts a timeout I debated adding an optional parameter for the timeout to the existing GetRaw method (which would be my personal preference) but it would be a breaking change and I doubt the Octokit team would be interested in such a change * (GH-2802) Invoke `GetRaw` rather than `Get>byte[]>` when retrieving a repo's archive content. This ensure stream content are handled properly and solves the problem described in GitHub issue 2802 * (GH-2802) Fix unit tests that got broken due to my recent change to the GetArchive method * (GH-2802) Fix formatting * (GH-2802) Fix more formatting
This commit is contained in:
@@ -242,7 +242,21 @@ namespace Octokit
|
||||
Endpoint = uri.ApplyParameters(parameters)
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/// <inheritdoc/>
|
||||
public Task<IApiResponse<byte[]>> GetRaw(Uri uri, IDictionary<string, string> parameters, TimeSpan timeout)
|
||||
{
|
||||
Ensure.ArgumentNotNull(uri, nameof(uri));
|
||||
|
||||
return GetRaw(new Request
|
||||
{
|
||||
Method = HttpMethod.Get,
|
||||
BaseAddress = BaseAddress,
|
||||
Endpoint = uri.ApplyParameters(parameters),
|
||||
Timeout = timeout
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public Task<IApiResponse<Stream>> GetRawStream(Uri uri, IDictionary<string, string> parameters)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user