Skip to content

Commit

Permalink
change send method
Browse files Browse the repository at this point in the history
  • Loading branch information
martinscholz83 committed Jul 5, 2016
1 parent b4d0ea9 commit d2748c3
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions Octokit/Http/HttpClientAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,12 @@ public async Task<IResponse> Send(IRequest request, CancellationToken cancellati

var cancellationTokenForRequest = GetCancellationTokenForRequest(request, cancellationToken);

var response = await GetSuccessfulResponse(GetRequest(request), cancellationTokenForRequest);

return await BuildResponse(response).ConfigureAwait(false);
}
using(var requestMessage = BuildRequestMessage(request))
{
var response = await GetSuccessfulResponse(requestMessage, cancellationTokenForRequest);

private HttpRequestMessage GetRequest(IRequest request)
{
var requestMessage = BuildRequestMessage(request);
return requestMessage;
return await BuildResponse(response).ConfigureAwait(false);
}
}

private async Task<HttpResponseMessage> GetSuccessfulResponse(HttpRequestMessage request, CancellationToken cancellationToken)
Expand Down

0 comments on commit d2748c3

Please sign in to comment.