mirror of
https://github.com/Kareadita/Kavita.git
synced 2026-06-05 14:25:17 -04:00
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:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user