MCPcopy Create free account
hub / github.com/TryCatchLearn/Restore-v2 / HttpExtensions

Class HttpExtensions

API/Extensions/HttpExtensions.cs:8–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6namespace API.Extensions;
7
8public static class HttpExtensions
9{
10 public static void AddPaginationHeader(this HttpResponse response, PaginationMetadata metadata)
11 {
12 var options = new JsonSerializerOptions{PropertyNamingPolicy = JsonNamingPolicy.CamelCase};
13
14 response.Headers.Append("Pagination", JsonSerializer.Serialize(metadata, options));
15 response.Headers.Append(HeaderNames.AccessControlExposeHeaders, "Pagination");
16 }
17}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected