Skip to content

Commit

Permalink
Fix 'ShouldPassRawDataToOnRawResponseReceived'
Browse files Browse the repository at this point in the history
  • Loading branch information
maximn committed Oct 9, 2024
1 parent 03e8fea commit ec46889
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
1 change: 0 additions & 1 deletion GoogleMapsApi.Test/IntegrationTests/DistanceMatrixTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ static Uri onUriCreated(Uri uri)
}

[Test]
[Ignore("Need to fix it")]
public async Task ShouldPassRawDataToOnRawResponseReceived()
{
var request = new DistanceMatrixRequest
Expand Down
13 changes: 7 additions & 6 deletions GoogleMapsApi/Engine/MapsAPIGenericEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
using System.Runtime.Serialization.Json;
using System.Threading;
using System.Threading.Tasks;
using System.Text;


namespace GoogleMapsApi.Engine
{
Expand All @@ -26,16 +28,15 @@ protected internal static async Task<TResponse> QueryGoogleAPIAsync(TRequest req
if (request == null)
throw new ArgumentNullException(nameof(request));

var uri = request.GetUri();
if (OnUriCreated != null)
{
uri = OnUriCreated(uri);
}

var requstUri = request.GetUri();
var uri = OnUriCreated?.Invoke(requstUri) ?? requstUri;

var client = new HttpClient();

var response = await client.DownloadDataTaskAsyncAsString(uri, timeout, token).ConfigureAwait(false);

OnRawResponseReceived?.Invoke(Encoding.UTF8.GetBytes(response));

return JsonConvert.DeserializeObject<TResponse>(response);
}

Expand Down

0 comments on commit ec46889

Please sign in to comment.