Skip to content

Commit

Permalink
Merge pull request #765 from appwrite/fix-dotnet-sdks
Browse files Browse the repository at this point in the history
Fix: byte array check to fix GetFileDownload function in .NET SDK
  • Loading branch information
abnegate authored Jan 31, 2024
2 parents f875c96 + e2c665d commit 23fae03
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions templates/dotnet/src/Appwrite/Client.cs.twig
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ namespace {{ spec.title | caseUcfirst }}
.FirstOrDefault() ?? string.Empty;

var isJson = contentType.Contains("application/json");
var isBytes = contentType.Contains("application/octet-stream");

if (code >= 400) {
var message = await response.Content.ReadAsStringAsync();
Expand All @@ -248,13 +247,9 @@ namespace {{ spec.title | caseUcfirst }}

return (dict as T)!;
}
else if (isBytes)
{
return ((await response.Content.ReadAsByteArrayAsync()) as T)!;
}
else
{
return default!;
return ((await response.Content.ReadAsByteArrayAsync()) as T)!;
}
}

Expand Down

0 comments on commit 23fae03

Please sign in to comment.