mirror of
https://github.com/bitechdev/ResolveSpec.git
synced 2026-10-03 03:51:59 +00:00
fix(clients): verify C# client, read Content-Range from content headers
This commit is contained in:
@@ -169,7 +169,9 @@ public sealed class FuncSpecClient
|
||||
};
|
||||
if (list)
|
||||
{
|
||||
resp.Headers.TryGetValues("Content-Range", out var cr);
|
||||
// Content-Range is a content header in HttpClient; fall back to response headers.
|
||||
IEnumerable<string>? cr = null;
|
||||
if (!resp.Content.Headers.TryGetValues("Content-Range", out cr)) resp.Headers.TryGetValues("Content-Range", out cr);
|
||||
r.Metadata = MetadataFrom(cr?.FirstOrDefault(), o);
|
||||
}
|
||||
return r;
|
||||
|
||||
@@ -28,7 +28,7 @@ public sealed class ResolveSpecClient
|
||||
_ => Convert.ToString(id, System.Globalization.CultureInfo.InvariantCulture),
|
||||
};
|
||||
|
||||
static string[]? BodyId(object? id) => id is IEnumerable<string> e and not string ? e.ToArray() : null;
|
||||
static string[]? BodyId(object? id) => id is IEnumerable<string> e ? e.ToArray() : null;
|
||||
|
||||
string Url(string schema, string entity, string? id)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user