Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Forbury.Integrations/API/v1/Clients/ForburyApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ namespace Forbury.Integrations.API.v1.Clients
{
public abstract class ForburyApiClient : IForburyApiClient
{
const string ApplicationJson = "application/json";

protected readonly HttpClient _httpClient;

public ForburyApiClient(HttpClient httpClient)
Expand Down Expand Up @@ -64,7 +66,7 @@ protected async Task<TResult> PostAsync<TRequest, TResult>(string requestUri, TR
var serializedBody = JsonConvert.SerializeObject(requestBody, new JsonSerializerSettings() { ContractResolver = new CamelCasePropertyNamesContractResolver() });

HttpResponseMessage response = await _httpClient.PostAsync(requestUri,
new StringContent(serializedBody, Encoding.UTF8, MediaTypeNames.Application.Json),
new StringContent(serializedBody, Encoding.UTF8, ApplicationJson),
cancellationToken);

await CatchResponseFailure(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ public static class ModelExtractContentTypeExtensions
{
public static string ToMediaType(this ModelExtractFileType contentType)
{
return contentType switch
switch (contentType)
{
ModelExtractFileType.Pdf => MediaTypeNames.Application.Pdf,
ModelExtractFileType.Jpeg => MediaTypeNames.Image.Jpeg,
_ => throw new NotSupportedException("Content type not supported.")
};
case ModelExtractFileType.Pdf:
return MediaTypeNames.Application.Pdf;
case ModelExtractFileType.Jpeg:
return MediaTypeNames.Image.Jpeg;
default:
throw new NotSupportedException("Content type not supported.");
}
}
}
}
2 changes: 1 addition & 1 deletion src/Forbury.Integrations/Forbury.Integrations.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PropertyGroup>
<AssemblyName>Forbury.Integrations</AssemblyName>
<PackageId>Forbury.Integrations</PackageId>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>net48;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static bool IsSignatureCompatible(this IHeaderDictionary headers, string

var receivedSignature =
headers[Constants.SignatureHeaderName].ToString()
.Split("=");
.Split('=');

string computedSignature;
switch (receivedSignature[0])
Expand Down