Progress Overhaul + Profile Page and a LOT more! (#4262)

Co-authored-by: Amelia <77553571+Fesaa@users.noreply.github.com>
Co-authored-by: Robbie Davis <robbie@therobbiedavis.com>
This commit is contained in:
Joe Milazzo
2025-12-09 10:00:11 -07:00
committed by GitHub
parent 4ac13f1f25
commit 9f29fa593d
645 changed files with 25585 additions and 4805 deletions
+15 -13
View File
@@ -1,9 +1,11 @@
using System;
using API.Constants;
using System.Linq;
using System.Threading.Tasks;
using Flurl.Http;
using Kavita.Common;
using Kavita.Common.EnvironmentInfo;
using Microsoft.Net.Http.Headers;
using Microsoft.AspNetCore.StaticFiles;
namespace API.Extensions;
@@ -46,25 +48,25 @@ public static class FlurlExtensions
public static IFlurlRequest WithKavitaPlusHeaders(this string request, string license, string? anilistToken = null)
{
return request
.WithHeader("Accept", "application/json")
.WithHeader("User-Agent", "Kavita")
.WithHeader("x-license-key", license)
.WithHeader("x-installId", HashUtil.ServerToken())
.WithHeader("x-anilist-token", anilistToken ?? string.Empty)
.WithHeader("x-kavita-version", BuildInfo.Version)
.WithHeader("Content-Type", "application/json")
.WithHeader(HeaderNames.Accept, "application/json")
.WithHeader(HeaderNames.UserAgent, "Kavita")
.WithHeader(Headers.LicenseKey, license)
.WithHeader(Headers.InstallId, HashUtil.ServerToken())
.WithHeader(Headers.AnilistToken, anilistToken ?? string.Empty)
.WithHeader(Headers.KavitaVersion, BuildInfo.Version)
.WithHeader(HeaderNames.ContentType, "application/json")
.WithTimeout(TimeSpan.FromSeconds(Configuration.DefaultTimeOutSecs));
}
public static IFlurlRequest WithBasicHeaders(this string request, string apiKey)
{
return request
.WithHeader("Accept", "application/json")
.WithHeader("User-Agent", "Kavita")
.WithHeader("x-api-key", apiKey)
.WithHeader("x-installId", HashUtil.ServerToken())
.WithHeader("x-kavita-version", BuildInfo.Version)
.WithHeader("Content-Type", "application/json")
.WithHeader(HeaderNames.Accept, "application/json")
.WithHeader(HeaderNames.UserAgent, "Kavita")
.WithHeader(Headers.ApiKey, apiKey)
.WithHeader(Headers.InstallId, HashUtil.ServerToken())
.WithHeader(Headers.KavitaVersion, BuildInfo.Version)
.WithHeader(HeaderNames.ContentType, "application/json")
.WithTimeout(TimeSpan.FromSeconds(Configuration.DefaultTimeOutSecs));
}
}