From ddd05c9a096ed204a0e19ddcf2bcfb22db59c399 Mon Sep 17 00:00:00 2001 From: Uruk Date: Wed, 6 Mar 2024 03:52:01 +0100 Subject: [PATCH] Remove clock and change add to append --- .../Authentication/ApiKeyAuthenticationHandler.cs | 3 +-- .../Authentication/BasicAuthenticationHandler.cs | 8 ++++---- src/Radarr.Http/Authentication/NoAuthenticationHandler.cs | 5 ++--- src/Radarr.Http/Middleware/VersionMiddleware.cs | 2 +- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/Radarr.Http/Authentication/ApiKeyAuthenticationHandler.cs b/src/Radarr.Http/Authentication/ApiKeyAuthenticationHandler.cs index 8de970ffe..e934cc84e 100644 --- a/src/Radarr.Http/Authentication/ApiKeyAuthenticationHandler.cs +++ b/src/Radarr.Http/Authentication/ApiKeyAuthenticationHandler.cs @@ -27,9 +27,8 @@ namespace Radarr.Http.Authentication public ApiKeyAuthenticationHandler(IOptionsMonitor options, ILoggerFactory logger, UrlEncoder encoder, - ISystemClock clock, IConfigFileProvider config) - : base(options, logger, encoder, clock) + : base(options, logger, encoder) { _apiKey = config.ApiKey; } diff --git a/src/Radarr.Http/Authentication/BasicAuthenticationHandler.cs b/src/Radarr.Http/Authentication/BasicAuthenticationHandler.cs index 95f67fbad..6acf888cb 100644 --- a/src/Radarr.Http/Authentication/BasicAuthenticationHandler.cs +++ b/src/Radarr.Http/Authentication/BasicAuthenticationHandler.cs @@ -6,6 +6,7 @@ using System.Text.Encodings.Web; using System.Text.RegularExpressions; using System.Threading.Tasks; using Microsoft.AspNetCore.Authentication; +using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using NzbDrone.Common.EnvironmentInfo; @@ -20,9 +21,8 @@ namespace Radarr.Http.Authentication public BasicAuthenticationHandler(IAuthenticationService authService, IOptionsMonitor options, ILoggerFactory logger, - UrlEncoder encoder, - ISystemClock clock) - : base(options, logger, encoder, clock) + UrlEncoder encoder) + : base(options, logger, encoder) { _authService = authService; } @@ -71,7 +71,7 @@ namespace Radarr.Http.Authentication protected override Task HandleChallengeAsync(AuthenticationProperties properties) { - Response.Headers.Add("WWW-Authenticate", $"Basic realm=\"{BuildInfo.AppName}\""); + Response.Headers.Append("WWW-Authenticate", $"Basic realm=\"{BuildInfo.AppName}\""); Response.StatusCode = 401; return Task.CompletedTask; } diff --git a/src/Radarr.Http/Authentication/NoAuthenticationHandler.cs b/src/Radarr.Http/Authentication/NoAuthenticationHandler.cs index 29449c7e0..3d8ff03c4 100644 --- a/src/Radarr.Http/Authentication/NoAuthenticationHandler.cs +++ b/src/Radarr.Http/Authentication/NoAuthenticationHandler.cs @@ -13,9 +13,8 @@ namespace Radarr.Http.Authentication { public NoAuthenticationHandler(IOptionsMonitor options, ILoggerFactory logger, - UrlEncoder encoder, - ISystemClock clock) - : base(options, logger, encoder, clock) + UrlEncoder encoder) + : base(options, logger, encoder) { } diff --git a/src/Radarr.Http/Middleware/VersionMiddleware.cs b/src/Radarr.Http/Middleware/VersionMiddleware.cs index c3019ac3f..41e76fd7c 100644 --- a/src/Radarr.Http/Middleware/VersionMiddleware.cs +++ b/src/Radarr.Http/Middleware/VersionMiddleware.cs @@ -22,7 +22,7 @@ namespace Radarr.Http.Middleware { if (context.Request.IsApiRequest() && !context.Response.Headers.ContainsKey(VERSIONHEADER)) { - context.Response.Headers.Add(VERSIONHEADER, _version); + context.Response.Headers.Append(VERSIONHEADER, _version); } await _next(context);